@@ -59,7 +59,8 @@ function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {
5959 $ name = $ this ->aliases [$ name ] ?? $ name ;
6060 $ wrappedInstance = match (true ) {
6161 isset ($ this ->fileMap [$ name ]) => $ this ->load ($ this ->fileMap [$ name ], false ),
62- (new \ReflectionMethod ($ this , $ method = $ this ->methodMap [$ name ]))->isStatic () => $ this ->{$ method }($ this , false ),
62+ !$ method = $ this ->methodMap [$ name ] ?? null => throw new \LogicException (\sprintf ('The "%s" service is synthetic and cannot be reset. ' , $ name )),
63+ (new \ReflectionMethod ($ this , $ method ))->isStatic () => $ this ->{$ method }($ this , false ),
6364 default => $ this ->{$ method }(false ),
6465 };
6566 $ manager ->setProxyInitializer (null );
@@ -86,7 +87,8 @@ function () use ($name) {
8687
8788 return match (true ) {
8889 isset ($ this ->fileMap [$ name ]) => $ this ->load ($ this ->fileMap [$ name ], false ),
89- (new \ReflectionMethod ($ this , $ method = $ this ->methodMap [$ name ]))->isStatic () => $ this ->{$ method }($ this , false ),
90+ !$ method = $ this ->methodMap [$ name ] ?? null => throw new \LogicException (\sprintf ('The "%s" service is synthetic and cannot be reset. ' , $ name )),
91+ (new \ReflectionMethod ($ this , $ method ))->isStatic () => $ this ->{$ method }($ this , false ),
9092 default => $ this ->{$ method }(false ),
9193 };
9294 },
0 commit comments