lib/Context.php
private function getReflectionParameters(callable $callable)
    {
        $reflectionParams = [];

        if (is_array($callable)) {
            // Callable array
            $reflector = new \ReflectionMethod($callable[0], $callable[1]);
            $reflectionParams = $reflector->getParameters();
        } else if (is_string($callable)) {
            // Callable function string
            $reflector = new \ReflectionFunction($callable);
            $reflectionParams = $reflector->getParameters();
        } else if (is_a($callable, 'Closure') || is_callable($callable, '__invoke')) {
            /** @var \Closure $callable */
            $reflector = new \ReflectionObject($callable);
            $reflectionParams = $reflector->getMethod('__invoke')->getParameters();
        }

        return $reflectionParams;
    }
private function getReflectionParameters(callable $callable)
    {
        $reflectionParams = [];

        if (is_array($callable)) {
            // Callable array
            $reflector = new \ReflectionMethod($callable[0], $callable[1]);
            $reflectionParams = $reflector->getParameters();
        } else if (is_string($callable)) {
            // Callable function string
            $reflector = new \ReflectionFunction($callable);
            $reflectionParams = $reflector->getParameters();
        } else if (is_a($callable, 'Closure') || is_callable($callable, '__invoke')) {
            /** @var \Closure $callable */
            $reflector = new \ReflectionObject($callable);
            $reflectionParams = $reflector->getMethod('__invoke')->getParameters();
        }

        return $reflectionParams;
    }
private function getReflectionParameters ( callable $ callable ) { $ reflectionParams = [ ] ; if ( is_array ( $ callable ) ) { // Callable array $ reflector = new \ ReflectionMethod ( $ callable [ 0 ] , $ callable [ 1 ] ) ; $ reflectionParams = $ reflector -> getParameters ( ) ; } else if ( is_string ( $ callable ) ) { // Callable function string $ reflector = new \ ReflectionFunction ( $ callable ) ; $ reflectionParams = $ reflector -> getParameters ( ) ; } else if ( is_a ( $ callable , 'Closure' ) || is_callable ( $ callable , '__invoke' ) ) { /** @var \Closure $callable */ $ reflector = new \ ReflectionObject ( $ callable ) ; $ reflectionParams = $ reflector -> getMethod ( '__invoke' ) -> getParameters ( ) ; } return $ reflectionParams ; }
Given a callable function, attempts to determine the reflection parameters.

@param callable $callable
@return \ReflectionParameter[]
Given a callable function attempts to determine the reflection parameters .