protected function resolveAfter($after)
    {
        $getAfter = $this->resolveMiddleware($after);

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

            return $callback($request, $response, $app);
        };
    }