This repository was archived by the owner on Jan 21, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,10 @@ public static function match(\ReflectionMethod $method): bool
6464 if ($ method ->getNumberOfParameters () != 2 ) {
6565 return false ;
6666 }
67-
68- $ ctx = $ method ->getParameters ()[0 ]->getClass ();
69- $ in = $ method ->getParameters ()[1 ]->getClass ();
67+ $ ctxType = $ method ->getParameters ()[0 ]->getType ();
68+ $ inType = $ method ->getParameters ()[1 ]->getType ();
69+ $ ctx = $ ctxType && $ ctxType instanceof \ReflectionNamedType && !$ ctxType ->isBuiltin () ? new \ReflectionClass ($ ctxType ->getName ()) : null ;
70+ $ in = $ inType && $ inType instanceof \ReflectionNamedType && ! $ inType ->isBuiltin () ? new \ReflectionClass ($ inType ->getName ()) : null ;
7071
7172 if (empty ($ ctx ) || !$ ctx ->implementsInterface (ContextInterface::class)) {
7273 return false ;
@@ -110,7 +111,7 @@ public static function parse(\ReflectionMethod $method): Method
110111
111112 $ m = new self ();
112113 $ m ->name = $ method ->getName ();
113- $ m ->input = $ method ->getParameters ()[1 ]->getClass ()->getName ();
114+ $ m ->input = $ method ->getParameters ()[1 ]->getType ()->getName ();
114115 $ m ->output = $ method ->getReturnType ()->getName ();
115116
116117 return $ m ;
You can’t perform that action at this time.
0 commit comments