protected function routeResponseMiddleware(Request $request, Response $response, Route $route): void
    {
        // If the route has no middleware
        if (null === $route->getMiddleware()) {
            // Return the response passed through
            return;
        }

        $this->app->kernel()->responseMiddleware(
            $request,
            $response,
            $route->getMiddleware()
        );
    }
protected function routeResponseMiddleware(Request $request, Response $response, Route $route): void
    {
        // If the route has no middleware
        if (null === $route->getMiddleware()) {
            // Return the response passed through
            return;
        }

        $this->app->kernel()->responseMiddleware(
            $request,
            $response,
            $route->getMiddleware()
        );
    }
protected function routeResponseMiddleware ( Request $ request , Response $ response , Route $ route ) : void { // If the route has no middleware if ( null === $ route -> getMiddleware ( ) ) { // Return the response passed through return ; } $ this -> app -> kernel ( ) -> responseMiddleware ( $ request , $ response , $ route -> getMiddleware ( ) ) ; }
Dispatch a route's after request handled middleware.

@param Request  $request  The request
@param Response $response The response
@param Route    $route    The route

@return void
Dispatch a route s after request handled middleware .