File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1010
1111class Reflection
1212{
13- public static function firstParameterType (callable $ callable ): string
13+ /**
14+ * @psalm-suppress UndefinedMethod
15+ */
16+ public static function firstParameterType (callable |object $ callable ): string
1417 {
1518 $ reflection = is_object ($ callable )
1619 ? (new ReflectionObject ($ callable ))->getMethod ('__invoke ' )
@@ -19,11 +22,11 @@ public static function firstParameterType(callable $callable): string
1922 $ parameters = $ reflection ->getParameters ();
2023
2124 $ parameterTypes = array_map (function (ReflectionParameter $ parameter ) {
22- $ class = $ parameter ->getType () && ! $ parameter -> getType ()-> isBuiltin ()
25+ $ class = $ parameter ->getType ()
2326 ? new ReflectionClass ($ parameter ->getType ()->getName ())
2427 : null ;
2528
26- return $ class ? $ class ->name : null ;
29+ return $ class? ->name;
2730 }, $ parameters );
2831
2932 return $ parameterTypes [0 ] ?? '' ;
You can’t perform that action at this time.
0 commit comments