protected static function getReflection($callable)
    {

        if (is_array($callable)) {
            return new ReflectionMethod($callable[0], $callable[1]);
        }

        if ($callable instanceof \Closure) {
            return new ReflectionFunction($callable);
        }

        if (is_object($callable)) {
            return new ReflectionMethod($callable, '__invoke');
        }

        // Should be a string until here
        if (strpos($callable, '::')) {
            list($class, $method) = explode('::', $callable);
            return new ReflectionMethod($class, $method);
        }

        return new ReflectionFunction($callable);
    }
protected static function getReflection($callable)
    {

        if (is_array($callable)) {
            return new ReflectionMethod($callable[0], $callable[1]);
        }

        if ($callable instanceof \Closure) {
            return new ReflectionFunction($callable);
        }

        if (is_object($callable)) {
            return new ReflectionMethod($callable, '__invoke');
        }

        // Should be a string until here
        if (strpos($callable, '::')) {
            list($class, $method) = explode('::', $callable);
            return new ReflectionMethod($class, $method);
        }

        return new ReflectionFunction($callable);
    }
protected static function getReflection ( $ callable ) { if ( is_array ( $ callable ) ) { return new ReflectionMethod ( $ callable [ 0 ] , $ callable [ 1 ] ) ; } if ( $ callable instanceof \ Closure ) { return new ReflectionFunction ( $ callable ) ; } if ( is_object ( $ callable ) ) { return new ReflectionMethod ( $ callable , '__invoke' ) ; } // Should be a string until here if ( strpos ( $ callable , '::' ) ) { list ( $ class , $ method ) = explode ( '::' , $ callable ) ; return new ReflectionMethod ( $ class , $ method ) ; } return new ReflectionFunction ( $ callable ) ; }
Get a reflection object for the passed callable. The callable
typehint is removed to support protected methods.

@param callable|array $callable

@return ReflectionFunctionAbstract

@throws \ReflectionException
Get a reflection object for the passed callable . The callable typehint is removed to support protected methods .