protected function resolveMiddleware($callback)
    {
        $callbackResolver = $this->callbackResolver;

        return function (Request $request) use ($callback, $callbackResolver) {
            if (!is_string($callback) || substr($callback, 0, 2) !== '::') {
                return $callbackResolver->resolveCallback($callback);
            }

            $controller = $callbackResolver->resolveCallback($request->attributes->get('_controller'));
            if (is_array($controller)) {
                list($cls, $_) = $controller;
            } elseif (is_string($controller)) {
                if (strpos($controller, '::') !== false) {
                    list($cls, $_) = explode('::', $controller);
                } else {
                    $cls = $controller;
                }
            } else {
                return null;
            }
            $callback = [$cls, substr($callback, 2)];

            return $callback;
        };
    }
protected function resolveMiddleware($callback)
    {
        $callbackResolver = $this->callbackResolver;

        return function (Request $request) use ($callback, $callbackResolver) {
            if (!is_string($callback) || substr($callback, 0, 2) !== '::') {
                return $callbackResolver->resolveCallback($callback);
            }

            $controller = $callbackResolver->resolveCallback($request->attributes->get('_controller'));
            if (is_array($controller)) {
                list($cls, $_) = $controller;
            } elseif (is_string($controller)) {
                if (strpos($controller, '::') !== false) {
                    list($cls, $_) = explode('::', $controller);
                } else {
                    $cls = $controller;
                }
            } else {
                return null;
            }
            $callback = [$cls, substr($callback, 2)];

            return $callback;
        };
    }
protected function resolveMiddleware ( $ callback ) { $ callbackResolver = $ this -> callbackResolver ; return function ( Request $ request ) use ( $ callback , $ callbackResolver ) { if ( ! is_string ( $ callback ) || substr ( $ callback , 0 , 2 ) !== '::' ) { return $ callbackResolver -> resolveCallback ( $ callback ) ; } $ controller = $ callbackResolver -> resolveCallback ( $ request -> attributes -> get ( '_controller' ) ) ; if ( is_array ( $ controller ) ) { list ( $ cls , $ _ ) = $ controller ; } elseif ( is_string ( $ controller ) ) { if ( strpos ( $ controller , '::' ) !== false ) { list ( $ cls , $ _ ) = explode ( '::' , $ controller ) ; } else { $ cls = $ controller ; } } else { return null ; } $ callback = [ $ cls , substr ( $ callback , 2 ) ] ; return $ callback ; } ; }
Returns a closure that will resolve the class to use
in middleware callback if one isn't specified.

@param array|string|null $callback

@return \Closure Invoke to get middleware callback
Returns a closure that will resolve the class to use in middleware callback if one isn t specified .