@@ -59,7 +59,8 @@ function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {
59
59
$ name = $ this ->aliases [$ name ] ?? $ name ;
60
60
$ wrappedInstance = match (true ) {
61
61
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 ),
63
64
default => $ this ->{$ method }(false ),
64
65
};
65
66
$ manager ->setProxyInitializer (null );
@@ -86,7 +87,8 @@ function () use ($name) {
86
87
87
88
return match (true ) {
88
89
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 ),
90
92
default => $ this ->{$ method }(false ),
91
93
};
92
94
},
0 commit comments