File tree 1 file changed +2
-6
lines changed
src/ProxyManager/ProxyGenerator/NullObject/MethodGenerator
1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,10 @@ class NullObjectMethodInterceptor extends MethodGenerator
19
19
*/
20
20
public static function generateMethod (MethodReflection $ originalMethod ): self
21
21
{
22
- $ method = static ::fromReflectionWithoutBodyAndDocBlock ($ originalMethod );
23
- $ originalReturnType = $ originalMethod ->getReturnType ();
22
+ $ method = static ::fromReflectionWithoutBodyAndDocBlock ($ originalMethod );
24
23
25
- if ($ originalReturnType instanceof ReflectionNamedType && $ originalReturnType ->getName () === 'never ' ) {
26
- $ method ->setBody ('throw new \Exception(); ' );
27
- } elseif ($ originalMethod ->returnsReference ()) {
24
+ if ($ originalMethod ->returnsReference ()) {
28
25
$ reference = IdentifierSuffixer::getIdentifier ('ref ' );
29
-
30
26
$ method ->setBody ("\$reference = null; \nreturn \$" . $ reference . '; ' );
31
27
}
32
28
You can’t perform that action at this time.
0 commit comments