@@ -1438,14 +1438,13 @@ private function on403(ErrorEvent $event)
14381438 *
14391439 * @param string $id
14401440 * @param Project|null $project
1441- * @param bool $forWrite
14421441 *
14431442 * @throws \GuzzleHttp\Exception\RequestException
14441443 *
14451444 * @return false|Subscription
14461445 * The subscription or false if not found.
14471446 */
1448- public function loadSubscription ($ id , Project $ project = null , $ forWrite = true )
1447+ public function loadSubscription ($ id , Project $ project = null )
14491448 {
14501449 $ organizations_enabled = $ this ->config ->getWithDefault ('api.organizations ' , false );
14511450 if (!$ organizations_enabled ) {
@@ -1454,25 +1453,6 @@ public function loadSubscription($id, Project $project = null, $forWrite = true)
14541453 return $ this ->getClient ()->getSubscription ($ id );
14551454 }
14561455
1457- // Attempt to load the subscription directly.
1458- // This is possible if the user is on the project's access list, or
1459- // if the user has access to all subscriptions.
1460- // However, while this legacy API works for reading, it won't always work for writing.
1461- if (!$ forWrite ) {
1462- try {
1463- $ subscription = $ this ->getClient ()->getSubscription ($ id );
1464- } catch (BadResponseException $ e ) {
1465- if (!$ e ->getResponse () || $ e ->getResponse ()->getStatusCode () !== 403 ) {
1466- throw $ e ;
1467- }
1468- $ subscription = false ;
1469- }
1470- if ($ subscription ) {
1471- $ this ->debug ('Loaded the subscription directly ' );
1472- return $ subscription ;
1473- }
1474- }
1475-
14761456 // Use the project's organization, if known.
14771457 $ organizationId = null ;
14781458 if (isset ($ project )) {
0 commit comments