private function getReflection(callable $callable): \ReflectionFunctionAbstract
    {
        if (\is_array($callable)) {
            //The callable is checked by PHP in the constructor by the type hiting
            $reflectionClass = new \ReflectionClass($callable[0]);

            return $reflectionClass->getMethod($callable[1]);
        }

        if (\is_object($callable) && !$callable instanceof \Closure) {
            //It's not a closure, so it's mandatory a invokable object (because the callable is valid)
            $reflectionClass = new \ReflectionClass($callable);

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

        return new \ReflectionFunction($callable);
    }
private function getReflection(callable $callable): \ReflectionFunctionAbstract
    {
        if (\is_array($callable)) {
            //The callable is checked by PHP in the constructor by the type hiting
            $reflectionClass = new \ReflectionClass($callable[0]);

            return $reflectionClass->getMethod($callable[1]);
        }

        if (\is_object($callable) && !$callable instanceof \Closure) {
            //It's not a closure, so it's mandatory a invokable object (because the callable is valid)
            $reflectionClass = new \ReflectionClass($callable);

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

        return new \ReflectionFunction($callable);
    }
private function getReflection ( callable $ callable ) : \ ReflectionFunctionAbstract { if ( \ is_array ( $ callable ) ) { //The callable is checked by PHP in the constructor by the type hiting $ reflectionClass = new \ ReflectionClass ( $ callable [ 0 ] ) ; return $ reflectionClass -> getMethod ( $ callable [ 1 ] ) ; } if ( \ is_object ( $ callable ) && ! $ callable instanceof \ Closure ) { //It's not a closure, so it's mandatory a invokable object (because the callable is valid) $ reflectionClass = new \ ReflectionClass ( $ callable ) ; return $ reflectionClass -> getMethod ( '__invoke' ) ; } return new \ ReflectionFunction ( $ callable ) ; }
To return the Reflection instance about this callable, supports functions, closures, objects methods or class
methods.

@param callable $callable

@return \ReflectionFunctionAbstract
@throws \ReflectionException
To return the Reflection instance about this callable supports functions closures objects methods or class methods .