File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public function getProvidedServices(): array
87
87
} else {
88
88
$ type = (new \ReflectionFunction ($ factory ))->getReturnType ();
89
89
90
- $ this ->providedTypes [$ name ] = $ type ? ($ type ->allowsNull () ? '? ' : '' ).$ type ->getName () : '? ' ;
90
+ $ this ->providedTypes [$ name ] = $ type ? ($ type ->allowsNull () ? '? ' : '' ).( $ type instanceof \ReflectionNamedType ? $ type ->getName () : $ type ) : '? ' ;
91
91
}
92
92
}
93
93
}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public static function getSubscribedServices(): array
40
40
}
41
41
42
42
if (self ::class === $ method ->getDeclaringClass ()->name && ($ returnType = $ method ->getReturnType ()) && !$ returnType ->isBuiltin ()) {
43
- $ services [self ::class.':: ' .$ method ->name ] = '? ' .$ returnType ->getName ();
43
+ $ services [self ::class.':: ' .$ method ->name ] = '? ' .( $ returnType instanceof \ReflectionNamedType ? $ returnType ->getName () : $ type );
44
44
}
45
45
}
46
46
You can’t perform that action at this time.
0 commit comments