src/Core/Router.php
protected function callAction(ControllerInterface $class, $action, $arguments, array $data)
    {
        if (null !== $this->action || $this->action->getName() !== $this->action) {
            $this->action = new \ReflectionMethod($class, $action);
        }

        $params = [];

        $dataBox = new Param($data);

        foreach ($arguments as $argument) {
            $params[$argument->name] = $dataBox->get($argument->name, $argument->defaultValue);
        }

        return $this->action->invokeArgs($class, $params);
    }
protected function callAction(ControllerInterface $class, $action, $arguments, array $data)
    {
        if (null !== $this->action || $this->action->getName() !== $this->action) {
            $this->action = new \ReflectionMethod($class, $action);
        }

        $params = [];

        $dataBox = new Param($data);

        foreach ($arguments as $argument) {
            $params[$argument->name] = $dataBox->get($argument->name, $argument->defaultValue);
        }

        return $this->action->invokeArgs($class, $params);
    }
protected function callAction ( ControllerInterface $ class , $ action , $ arguments , array $ data ) { if ( null !== $ this -> action || $ this -> action -> getName ( ) !== $ this -> action ) { $ this -> action = new \ ReflectionMethod ( $ class , $ action ) ; } $ params = [ ] ; $ dataBox = new Param ( $ data ) ; foreach ( $ arguments as $ argument ) { $ params [ $ argument -> name ] = $ dataBox -> get ( $ argument -> name , $ argument -> defaultValue ) ; } return $ this -> action -> invokeArgs ( $ class , $ params ) ; }
Calling action with request data in params

@param ControllerInterface $class
@param string $action
@param ActionAttribute[] $arguments
@param array $data
@return array|string
@throws \ReflectionException
Calling action with request data in params