@@ -332,34 +332,34 @@ public function action(string $name)
332332 return null ;
333333 }
334334
335- $ reflection = new \ReflectionClass ($ this -> pageInstance () );
335+ $ reflection = new \ReflectionClass ($ actions [ $ name ] );
336336
337- $ params = $ this ->getParams ();
338- $ headerColumns = str (request ()->header ('x-viper-bind-keys ' ))->explode (', ' );
339- $ headerValues = str (request ()->header ('x-viper-bind-values ' ))->explode (', ' );
337+ $ params = $ this ->getParams ();
338+ $ headerColumns = str (request ()->header ('x-viper-bind-keys ' ))->explode (', ' );
339+ $ headerValues = str (request ()->header ('x-viper-bind-values ' ))->explode (', ' );
340340
341- $ method = $ reflection ->getMethod ($ name );
341+ $ method = $ reflection ->getMethod ($ name );
342342
343- foreach ($ method ->getParameters () as $ param ) {
344- $ attrs = $ param ->getAttributes (Bind::class);
343+ foreach ($ method ->getParameters () as $ param ) {
344+ $ attrs = $ param ->getAttributes (Bind::class);
345345
346- if (empty ($ attrs )) {
347- continue ;
348- }
346+ if (empty ($ attrs )) {
347+ continue ;
348+ }
349349
350- $ attr = $ attrs [0 ]->newInstance ();
351- $ index = $ headerColumns ->search ($ param ->getName ());
350+ $ attr = $ attrs [0 ]->newInstance ();
351+ $ index = $ headerColumns ->search ($ param ->getName ());
352352
353- if ($ index === false ) {
354- continue ;
355- }
353+ if ($ index === false ) {
354+ continue ;
355+ }
356356
357- $ model = $ this ->resolveModel ($ param ->getType ()->getName (), $ headerValues [$ index ], $ attr ->column );
357+ $ model = $ this ->resolveModel ($ param ->getType ()->getName (), $ headerValues [$ index ], $ attr ->column );
358358
359- if ($ model ) {
360- $ params [$ param ->getName ()] = $ model ;
359+ if ($ model ) {
360+ $ params [$ param ->getName ()] = $ model ;
361+ }
361362 }
362- }
363363
364364 return app ()->call ($ actions [$ name ]->$ name (...), $ params );
365365 }
0 commit comments