RouteAwareTrait.php
protected function getRouteFromRequest(Request $request)
    {
        $attributes = $request->attributes->get('_route_params');

        if (isset($attributes[RouteObjectInterface::ROUTE_OBJECT])
            && ($attributes[RouteObjectInterface::ROUTE_OBJECT] instanceof RouteInterface)
        ) {
            return $attributes[RouteObjectInterface::ROUTE_OBJECT];
        }

        return null;
    }
protected function getRouteFromRequest(Request $request)
    {
        $attributes = $request->attributes->get('_route_params');

        if (isset($attributes[RouteObjectInterface::ROUTE_OBJECT])
            && ($attributes[RouteObjectInterface::ROUTE_OBJECT] instanceof RouteInterface)
        ) {
            return $attributes[RouteObjectInterface::ROUTE_OBJECT];
        }

        return null;
    }
protected function getRouteFromRequest ( Request $ request ) { $ attributes = $ request -> attributes -> get ( '_route_params' ) ; if ( isset ( $ attributes [ RouteObjectInterface :: ROUTE_OBJECT ] ) && ( $ attributes [ RouteObjectInterface :: ROUTE_OBJECT ] instanceof RouteInterface ) ) { return $ attributes [ RouteObjectInterface :: ROUTE_OBJECT ] ; } return null ; }
Get route from request.

@param Request $request

@return null|RouteInterface
Get route from request .