private function route(ServerRequestInterface $request)
    {
        $route = $request->getAttribute('route', false);
        if (! $route instanceof Route) {
            throw new BadHttpStackConfigurationException(
                "Dispatcher works with router middleware in order to process incoming requests. " .
                "Please check that the HTTP stack has the router middleware placed before the dispatcher. ".
                "Missing route in the request."
            );
        }
        return $route;
    }
private function route(ServerRequestInterface $request)
    {
        $route = $request->getAttribute('route', false);
        if (! $route instanceof Route) {
            throw new BadHttpStackConfigurationException(
                "Dispatcher works with router middleware in order to process incoming requests. " .
                "Please check that the HTTP stack has the router middleware placed before the dispatcher. ".
                "Missing route in the request."
            );
        }
        return $route;
    }
private function route ( ServerRequestInterface $ request ) { $ route = $ request -> getAttribute ( 'route' , false ) ; if ( ! $ route instanceof Route ) { throw new BadHttpStackConfigurationException ( "Dispatcher works with router middleware in order to process incoming requests. " . "Please check that the HTTP stack has the router middleware placed before the dispatcher. " . "Missing route in the request." ) ; } return $ route ; }
Get route attribute from request

@param ServerRequestInterface $request

@return Route

@throws BadHttpStackConfigurationException When the need route is missing from the request
Get route attribute from request