To extract controller's parameter from \Reflection Api and convert into ParameterInterface instance.

@return array
@throws \ReflectionException
161083
private function extractArguments(): array
    {
        $parameters = [];

        //Use the Reflection API to create Parameter Value object
        foreach ($this->getReflectionInstance()->getParameters() as $param) {
            $name = $param->getName();
            $hasDefault = $param->isDefaultValueAvailable();

            //Default value. To null if the parameter has no default value
            $defaultValue = null;
            if (true === $hasDefault) {
                $defaultValue = $param->getDefaultValue();
            }
            $class = $param->getClass();

            $parameters[$name] = new Parameter($name, $hasDefault, $defaultValue, $class);
        }

        return $parameters;
    }
980669
public function getController()
    {
        if (! $this->controller) {
            $class = $this->parseControllerCallback()[0];

            $this->controller = $this->container->make(ltrim($class, '\\'));
        }

        return $this->controller;
    }
1316591
public function getParameters()
    {
        if (null === $this->parameters) {
            $this->parameters = array();
            foreach ($this->reflection->getParameters() as $reflectionParameter) {
                $this->parameters[$reflectionParameter->getName()] = new CallbackParameter($reflectionParameter);
            }
        }

        return $this->parameters;
    }
818168
public function getControllerMetaData()
    {
        if (null == $this->controllerMetaData) {
            $controller = new Controller();
            $this->configureController($controller);
            $this->setControllerMetaData($controller);
        }
        return $this->controllerMetaData;
    }
1267718
protected function parseController($controller)
    {
        if (\is_string($controller) && false !== strpos($controller, '::')) {
            $controller = explode('::', $controller);
        }

        if (\is_array($controller)) {
            try {
                $r = new \ReflectionMethod($controller[0], $controller[1]);

                return [
                    'class' => \is_object($controller[0]) ? \get_class($controller[0]) : $controller[0],
                    'method' => $controller[1],
                    'file' => $r->getFileName(),
                    'line' => $r->getStartLine(),
                ];
            } catch (\ReflectionException $e) {
                if (\is_callable($controller)) {
                    // using __call or  __callStatic
                    return [
                        'class' => \is_object($controller[0]) ? \get_class($controller[0]) : $controller[0],
                        'method' => $controller[1],
                        'file' => 'n/a',
                        'line' => 'n/a',
                    ];
                }
            }
        }

        if ($controller instanceof \Closure) {
            $r = new \ReflectionFunction($controller);

            $controller = [
                'class' => $r->getName(),
                'method' => null,
                'file' => $r->getFileName(),
                'line' => $r->getStartLine(),
            ];

            if (false !== strpos($r->name, '{closure}')) {
                return $controller;
            }
            $controller['method'] = $r->name;

            if ($class = $r->getClosureScopeClass()) {
                $controller['class'] = $class->name;
            } else {
                return $r->name;
            }

            return $controller;
        }

        if (\is_object($controller)) {
            $r = new \ReflectionClass($controller);

            return [
                'class' => $r->getName(),
                'method' => null,
                'file' => $r->getFileName(),
                'line' => $r->getStartLine(),
            ];
        }

        return \is_string($controller) ? $controller : 'n/a';
    }
1179437
public function parameters()
	{
		if (isset($this->parameters))
		{
			return array_map(function($value)
			{
				return is_string($value) ? urldecode($value) : $value;

			}, $this->parameters);
		}

		throw new \LogicException("Route is not bound.");
	}
756503
protected function getParameterInfo()
    {
        $params = array();

        $parameters = $this->reflection->getParameters();
        foreach ($parameters as $parameter) {
            $params[$parameter->getName()] = array(
                'name'      => $parameter->getName(),
                'hint_type' => $parameter->getOriginalTypeHint(),
                'type'      => $parameter->getOriginalTypeHint(),
                'comment'   => null
            );

            if ($parameter->isDefaultValueAvailable()) {
                try {
                    $params[$parameter->getName()]['default'] = trim($parameter->getDefaultValueDefinition());
                } catch (\Exception\RuntimeException $e) {
                    // Just don't provide a default
                }
            }
        }

        $annotations = array_filter($this->getParser()->getAnnotations(), function ($v) {
            $e = explode(' ', $v);
            return isset($e[0]) && $e[0] == '@param';
        });
        foreach ($annotations as $parameter) {
            $parts = explode(' ', $parameter);

            if (count($parts) < 3) {
                continue;
            }

            $type = trim($parts[1]);
            $name = trim(str_replace('$', '', $parts[2]));
            $comment = trim(implode(' ', array_slice($parts, 3)));

            if (isset($params[$name])) {
                if ($params[$name]['type'] == null && $type) {
                    $params[$name]['type'] = $type;
                }
                if ($comment) {
                    $params[$name]['comment'] = $comment;
                }
            }
        }

        return $params;
    }
1187933
protected function _getController()
    {
        if (!$this->_controller instanceof KControllerInterface) {
            $this->_controller = $this->getObject($this->_controller);
        }

        return $this->_controller;
    }
1014181
public function getRequestParameters()
    {
        $aViewVariables = array();

        $aTmp = $this->GetAllInputFieldParameter();
        foreach (array_keys($aTmp) as $sTmpKey) {
            $aViewVariables[$sTmpKey] = $aTmp[$sTmpKey];
        }
        $aTmp = $this->GetUserAddressData();
        foreach (array_keys($aTmp) as $sTmpKey) {
            $aViewVariables[$sTmpKey] = $aTmp[$sTmpKey];
        }
        $aTmp = $this->GetPaymentTypeSpecifivParameter();
        foreach (array_keys($aTmp) as $sTmpKey) {
            $aViewVariables[$sTmpKey] = $aTmp[$sTmpKey];
        }

        return $aViewVariables;
    }
620010
private function getParameters()
    {
        $routeParameters = $this->request->attributes->get('_route_params');
        $parameters = $this->request->query->all();

        if ($routeParameters) {
            $parameters = array_merge($routeParameters, $parameters);
        }

        return $parameters;
    }
669552
protected function getVariables()
    {
        $reflection = new ReflectionClass($this);
        foreach ($reflection->getProperties(
            ReflectionProperty::IS_PROTECTED |
            ReflectionProperty::IS_PRIVATE |
            ReflectionProperty::IS_STATIC
        ) as $property) {
            $ignore[] = $property->name;
        }
        $values = [];
        foreach ($this as $prop => $value) {
            if (!in_array($prop, $ignore)) {
                if (is_object($value)) {
                    if (method_exists($value, 'jsonSerialize')) {
                        $value = $value->jsonSerialize();
                    } elseif (method_exists($value, 'getArrayCopy')) {
                        $value = $value->getArrayCopy();
                    }
                }
                $values[$prop] = $value;
            }
        }
        return $values;
    }
1234585
public function getController()
    {
        if(!($this->_controller instanceof KControllerInterface))
        {
            //Make sure we have a controller identifier
            if(!($this->_controller instanceof KObjectIdentifier)) {
                $this->setController($this->_controller);
            }

            $config = array(
                'request'    => $this->getRequest(),
                'response'   => $this->getResponse(),
                'user'       => $this->getUser(),
                'dispatched' => $this
            );

            $this->_controller = $this->getObject($this->_controller, $config);

            //Make sure the controller implements KControllerInterface
            if(!$this->_controller instanceof KControllerInterface)
            {
                throw new UnexpectedValueException(
                    'Controller: '.get_class($this->_controller).' does not implement KControllerInterface'
                );
            }
        }

        return $this->_controller;
    }
837190
public function extractRouteFromController(\ReflectionClass $reflectionController)
    {
        $classAnnotations = $this->extractorFactory->extract($reflectionController, Extractor::CLASS_ANNOTATION);
        foreach ($classAnnotations as $annotation) {
            if ($annotation instanceof Route) {
                return $annotation;
            }
        }

        throw new RuntimeException(sprintf('Class "%s" does not has any Route annotation', $reflectionController->getName()));
    }
903620
public function getContext(): ?array
    {
        if ($this->currentRequest === null) {
            return null;
        }

        $controller = null;

        if ($route = $this->currentRequest->route()) {
            $controller = $route->controller;

            if (! $controller && ! is_string($route->action['uses'])) {
                $controller = $route->action['uses'];
            }
        }

        return [
            'uri' => $this->currentRequest->getUri(),
            'method' => $this->currentRequest->getMethod(),
            'controller' => $controller ? $this->cloner->cloneVar(class_basename($controller)) : $controller,
            'identifier' => spl_object_hash($this->currentRequest),
        ];
    }
983333
public function getRequestParameters()
    {
        $parameters = [];

        if ($this->isRequestPost()) {
            $input = file_get_contents("php://input");
            $arguments = explode('&', $input);
            foreach ($arguments as $argument) {
                $argumentSplited = explode('=', $argument);
                $key = urldecode($argumentSplited[0]);
                $value = urldecode($argumentSplited[1]);
                // for multiple values
                if (strpos($value, ',')) {
                    $value = explode(',', $value);
                }
                if (substr($key, -2) == '[]') {
                    $key = substr($key, 0, strlen($key)-2);
                    if (!isset($parameters[$key])) {
                        $parameters[$key] = [];
                    }
                    $parameters[$key][] = $value;
                } else {
                    $parameters[$key] = $value;
                }
            }
        } else {
            $parameters = parent::getRequestParameters();
        }

        return $parameters;
    }
1332725
public function getParameters()
    {
        $extendedParameters = [];
        foreach (parent::getParameters() as $parameter) {
            $extendedParameters[] = new ParameterReflection([$this->getDeclaringClass()->getName(), $this->getName()], $parameter->getName());
        }
        return $extendedParameters;
    }
357693
public function generateRemotingApi() {
        $list = array();
        foreach($this->remotingBundles as $bundle) {
            $bundleRef = new \ReflectionClass($bundle);
            $controllerDir = new Finder();
            $controllerDir->files()->in(dirname($bundleRef->getFileName()).'/Controller/')->name('/.*Controller\.php$/');
            foreach($controllerDir as $controllerFile) {
                $controller = $bundleRef->getNamespaceName() . "\\Controller\\" . substr($controllerFile->getFilename(), 0, -4);
                $controllerRef = new \ReflectionClass($controller);
                foreach ($controllerRef->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
                    /** @var $methodDirectAnnotation Direct */
                    $methodDirectAnnotation = $this->annoReader->getMethodAnnotation($method, 'Tpg\ExtjsBundle\Annotation\Direct');
                    if ($methodDirectAnnotation !== null) {
                        $nameSpace = str_replace("\\", ".", $bundleRef->getNamespaceName());
                        $className = str_replace("Controller", "", $controllerRef->getShortName());
                        $methodName = str_replace("Action", "", $method->getName());
                        $list[$nameSpace][$className][] = array(
                            'name'=>$methodName,
                            'len' => count($method->getParameters())
                        );
                    }
                }
            }
        }
        return $list;
    }