protected function resolveBefore($before)
    {
        $getBefore = $this->resolveMiddleware($before);

        return function (Request $request, Application $app) use ($getBefore) {
            $callback = $getBefore($request);
            if (!is_callable($callback)) {
                return null;
            }

            return $callback($request, $app);
        };
    }
protected function resolveBefore($before)
    {
        $getBefore = $this->resolveMiddleware($before);

        return function (Request $request, Application $app) use ($getBefore) {
            $callback = $getBefore($request);
            if (!is_callable($callback)) {
                return null;
            }

            return $callback($request, $app);
        };
    }
protected function resolveBefore ( $ before ) { $ getBefore = $ this -> resolveMiddleware ( $ before ) ; return function ( Request $ request , Application $ app ) use ( $ getBefore ) { $ callback = $ getBefore ( $ request ) ; if ( ! is_callable ( $ callback ) ) { return null ; } return $ callback ( $ request , $ app ) ; } ; }
Returns a closure that will resolve the middleware callback
to call on kernel request and call it.

@param array|string|null $before

@return \Closure
Returns a closure that will resolve the middleware callback to call on kernel request and call it .