src/Invocation/InvocableInspector.php
public function callbackReflector($callback): ReflectionFunctionAbstract
    {
        while ($callback instanceof WrappedInvocable) {
            $callback = $callback->callback();
        }

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

        if (is_string($callback) && false !== strpos($callback, '::')) {
            list($className, $methodName) = explode('::', $callback);

            return new ReflectionMethod($className, $methodName);
        }

        if (is_object($callback) && !$callback instanceof Closure) {
            return new ReflectionMethod($callback, '__invoke');
        }

        return new ReflectionFunction($callback);
    }
public function callbackReflector($callback): ReflectionFunctionAbstract
    {
        while ($callback instanceof WrappedInvocable) {
            $callback = $callback->callback();
        }

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

        if (is_string($callback) && false !== strpos($callback, '::')) {
            list($className, $methodName) = explode('::', $callback);

            return new ReflectionMethod($className, $methodName);
        }

        if (is_object($callback) && !$callback instanceof Closure) {
            return new ReflectionMethod($callback, '__invoke');
        }

        return new ReflectionFunction($callback);
    }
public function callbackReflector ( $ callback ) : ReflectionFunctionAbstract { while ( $ callback instanceof WrappedInvocable ) { $ callback = $ callback -> callback ( ) ; } if ( is_array ( $ callback ) ) { return new ReflectionMethod ( $ callback [ 0 ] , $ callback [ 1 ] ) ; } if ( is_string ( $ callback ) && false !== strpos ( $ callback , '::' ) ) { list ( $ className , $ methodName ) = explode ( '::' , $ callback ) ; return new ReflectionMethod ( $ className , $ methodName ) ; } if ( is_object ( $ callback ) && ! $ callback instanceof Closure ) { return new ReflectionMethod ( $ callback , '__invoke' ) ; } return new ReflectionFunction ( $ callback ) ; }
Get the appropriate reflector for the supplied callback.

@param callable $callback The callback.

@return ReflectionFunctionAbstract The reflector.
@throws ReflectionException        If the callback cannot be reflected.
Get the appropriate reflector for the supplied callback .