protected function getMethodArguments($controllerClass, $methodName)
    {
        $actionArguments = array();

        $reflectionAction = new \ReflectionMethod($controllerClass, $methodName);
        $actionParametersReflections = $reflectionAction->getParameters();
        foreach ($actionParametersReflections as $actionParameterReflection) {
            $parameterName = $actionParameterReflection->getName();
            if (
                !empty($this->bindings[$controllerClass][$methodName])
                && array_key_exists($parameterName, $this->bindings[$controllerClass][$methodName])
            ) {
                $parameterValue = $this->serviceContainer->getService($this->bindings[$controllerClass][$methodName][$parameterName]);
                $actionArguments[$parameterName] = $parameterValue;
            } elseif (
                !empty($this->argumentBindings[$controllerClass][$methodName])
                && array_key_exists($parameterName, $this->argumentBindings[$controllerClass][$methodName])
            ) {
                $actionArguments[$parameterName] = $this->argumentBindings[$controllerClass][$methodName][$parameterName];
            } elseif ($actionParameterReflection->isOptional()) {
                $actionArguments[$parameterName] = $actionParameterReflection->getDefaultValue();
            } else {
                throw new Exception("No value provided for parameter '{$parameterName}' of '{$controllerClass}::{$methodName}'");
            }
        }
        return $actionArguments;
    }
protected function getMethodArguments($controllerClass, $methodName)
    {
        $actionArguments = array();

        $reflectionAction = new \ReflectionMethod($controllerClass, $methodName);
        $actionParametersReflections = $reflectionAction->getParameters();
        foreach ($actionParametersReflections as $actionParameterReflection) {
            $parameterName = $actionParameterReflection->getName();
            if (
                !empty($this->bindings[$controllerClass][$methodName])
                && array_key_exists($parameterName, $this->bindings[$controllerClass][$methodName])
            ) {
                $parameterValue = $this->serviceContainer->getService($this->bindings[$controllerClass][$methodName][$parameterName]);
                $actionArguments[$parameterName] = $parameterValue;
            } elseif (
                !empty($this->argumentBindings[$controllerClass][$methodName])
                && array_key_exists($parameterName, $this->argumentBindings[$controllerClass][$methodName])
            ) {
                $actionArguments[$parameterName] = $this->argumentBindings[$controllerClass][$methodName][$parameterName];
            } elseif ($actionParameterReflection->isOptional()) {
                $actionArguments[$parameterName] = $actionParameterReflection->getDefaultValue();
            } else {
                throw new Exception("No value provided for parameter '{$parameterName}' of '{$controllerClass}::{$methodName}'");
            }
        }
        return $actionArguments;
    }
protected function getMethodArguments ( $ controllerClass , $ methodName ) { $ actionArguments = array ( ) ; $ reflectionAction = new \ ReflectionMethod ( $ controllerClass , $ methodName ) ; $ actionParametersReflections = $ reflectionAction -> getParameters ( ) ; foreach ( $ actionParametersReflections as $ actionParameterReflection ) { $ parameterName = $ actionParameterReflection -> getName ( ) ; if ( ! empty ( $ this -> bindings [ $ controllerClass ] [ $ methodName ] ) && array_key_exists ( $ parameterName , $ this -> bindings [ $ controllerClass ] [ $ methodName ] ) ) { $ parameterValue = $ this -> serviceContainer -> getService ( $ this -> bindings [ $ controllerClass ] [ $ methodName ] [ $ parameterName ] ) ; $ actionArguments [ $ parameterName ] = $ parameterValue ; } elseif ( ! empty ( $ this -> argumentBindings [ $ controllerClass ] [ $ methodName ] ) && array_key_exists ( $ parameterName , $ this -> argumentBindings [ $ controllerClass ] [ $ methodName ] ) ) { $ actionArguments [ $ parameterName ] = $ this -> argumentBindings [ $ controllerClass ] [ $ methodName ] [ $ parameterName ] ; } elseif ( $ actionParameterReflection -> isOptional ( ) ) { $ actionArguments [ $ parameterName ] = $ actionParameterReflection -> getDefaultValue ( ) ; } else { throw new Exception ( "No value provided for parameter '{$parameterName}' of '{$controllerClass}::{$methodName}'" ) ; } } return $ actionArguments ; }
Get arguments of Controller's Action or constructor

@param string $controllerClass Controller class name
@param string $methodName      Method name

@throws Exception

@return array
Get arguments of Controller s Action or constructor