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
8787 } else {
8888 $ type = (new \ReflectionFunction ($ factory ))->getReturnType ();
8989
90- $ this ->providedTypes [$ name ] = $ type ? ($ type ->allowsNull () ? '? ' : '' ).$ type ->getName () : '? ' ;
90+ $ this ->providedTypes [$ name ] = $ type ? ($ type ->allowsNull () ? '? ' : '' ).( $ type instanceof \ReflectionNamedType ? $ type ->getName () : $ type ) : '? ' ;
9191 }
9292 }
9393 }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public static function getSubscribedServices(): array
4040 }
4141
4242 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 );
4444 }
4545 }
4646
You can’t perform that action at this time.
0 commit comments