protected function resolveCallableArguments(
        callable $callable,
        array $providedArguments
    )/*# : array */ {
        // object with __invoke defined or \Closure
        if (is_object($callable) && !$callable instanceof \Closure) {
            $reflector = new \ReflectionClass($callable);
            $method = $reflector->getMethod('__invoke');

        // array-like callable
        } elseif (is_array($callable)) {
            $reflector = new \ReflectionClass($callable[0]);
            $method = $reflector->getMethod($callable[1]);

        // simple function
        } else {
            $method = new \ReflectionFunction($callable);
        }

        // dereference the provided arguments
        $this->dereferenceArray($providedArguments);

        // match provided arguments with method parameter definitions
        return $this->matchMethodArguments(
            $method->getParameters(),
            $providedArguments
        );
    }
protected function resolveCallableArguments(
        callable $callable,
        array $providedArguments
    )/*# : array */ {
        // object with __invoke defined or \Closure
        if (is_object($callable) && !$callable instanceof \Closure) {
            $reflector = new \ReflectionClass($callable);
            $method = $reflector->getMethod('__invoke');

        // array-like callable
        } elseif (is_array($callable)) {
            $reflector = new \ReflectionClass($callable[0]);
            $method = $reflector->getMethod($callable[1]);

        // simple function
        } else {
            $method = new \ReflectionFunction($callable);
        }

        // dereference the provided arguments
        $this->dereferenceArray($providedArguments);

        // match provided arguments with method parameter definitions
        return $this->matchMethodArguments(
            $method->getParameters(),
            $providedArguments
        );
    }
protected function resolveCallableArguments ( callable $ callable , array $ providedArguments ) /*# : array */ { // object with __invoke defined or \Closure if ( is_object ( $ callable ) && ! $ callable instanceof \ Closure ) { $ reflector = new \ ReflectionClass ( $ callable ) ; $ method = $ reflector -> getMethod ( '__invoke' ) ; // array-like callable } elseif ( is_array ( $ callable ) ) { $ reflector = new \ ReflectionClass ( $ callable [ 0 ] ) ; $ method = $ reflector -> getMethod ( $ callable [ 1 ] ) ; // simple function } else { $ method = new \ ReflectionFunction ( $ callable ) ; } // dereference the provided arguments $ this -> dereferenceArray ( $ providedArguments ) ; // match provided arguments with method parameter definitions return $ this -> matchMethodArguments ( $ method -> getParameters ( ) , $ providedArguments ) ; }
Resolve arguments for a callable

@param  callable $callable
@param  array $providedArguments the provided arguments
@return array the resolved arguments
@throws LogicException
@throws NotFoundException
@access protected
Resolve arguments for a callable