private function getReflectionInstance()
    {
        if (\is_array($this->controller) && 2 === \count($this->controller)) {
            //Reflection the method's argument in the controller class
            return new \ReflectionMethod($this->controller[0], $this->controller[1]);
        }

        if (\is_object($this->controller) && !$this->controller instanceof \Closure) {
            //Reflection the method's arguments of the callable object
            $controllerReflected = new \ReflectionObject($this->controller);

            return $controllerReflected->getMethod('__invoke');
        }

        return new \ReflectionFunction($this->controller);
    }
private function getReflectionInstance()
    {
        if (\is_array($this->controller) && 2 === \count($this->controller)) {
            //Reflection the method's argument in the controller class
            return new \ReflectionMethod($this->controller[0], $this->controller[1]);
        }

        if (\is_object($this->controller) && !$this->controller instanceof \Closure) {
            //Reflection the method's arguments of the callable object
            $controllerReflected = new \ReflectionObject($this->controller);

            return $controllerReflected->getMethod('__invoke');
        }

        return new \ReflectionFunction($this->controller);
    }
private function getReflectionInstance ( ) { if ( \ is_array ( $ this -> controller ) && 2 === \ count ( $ this -> controller ) ) { //Reflection the method's argument in the controller class return new \ ReflectionMethod ( $ this -> controller [ 0 ] , $ this -> controller [ 1 ] ) ; } if ( \ is_object ( $ this -> controller ) && ! $ this -> controller instanceof \ Closure ) { //Reflection the method's arguments of the callable object $ controllerReflected = new \ ReflectionObject ( $ this -> controller ) ; return $ controllerReflected -> getMethod ( '__invoke' ) ; } return new \ ReflectionFunction ( $ this -> controller ) ; }
To generate the \Reflection object dedicated to the controller. The controller is a callable, so it can be
a method of an object, a invokable object, or a function.

@return \ReflectionFunction|\ReflectionMethod
@throws \ReflectionException
To generate the \ Reflection object dedicated to the controller . The controller is a callable so it can be a method of an object a invokable object or a function .