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 +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 @@ -64,9 +64,12 @@ public static function match(\ReflectionMethod $method): bool
6464 if ($ method ->getNumberOfParameters () != 2 ) {
6565 return false ;
6666 }
67+
68+ $ ctxType = $ method ->getParameters ()[0 ]->getType ();
69+ $ inType = $ method ->getParameters ()[1 ]->getType ();
6770
68- $ ctx = $ method -> getParameters ()[ 0 ]-> getClass () ;
69- $ in = $ method -> getParameters ()[ 1 ]-> getClass () ;
71+ $ ctx = $ ctxType && ! $ ctxType -> isBuiltin () ? new \ ReflectionClass ( $ ctxType -> getName ()) : null ;
72+ $ in = $ inType && ! $ inType -> isBuiltin () ? new \ ReflectionClass ( $ inType -> getName ()) : null ;
7073
7174 if (empty ($ ctx ) || !$ ctx ->implementsInterface (ContextInterface::class)) {
7275 return false ;
@@ -110,7 +113,7 @@ public static function parse(\ReflectionMethod $method): Method
110113
111114 $ m = new self ();
112115 $ m ->name = $ method ->getName ();
113- $ m ->input = $ method ->getParameters ()[1 ]->getClass ()->getName ();
116+ $ m ->input = $ method ->getParameters ()[1 ]->getType ()->getName ();
114117 $ m ->output = $ method ->getReturnType ()->getName ();
115118
116119 return $ m ;
You can’t perform that action at this time.
0 commit comments