public function getRoute(string $id) : array
    {
        foreach ($this->routes() as $url => $route) {
            if ($route['id'] == $id) {
                return $route;
            }
        }

        throw new \InvalidArgumentException(sprintf('No such route id found: %s', $id));
    }
public function getRoute(string $id) : array
    {
        foreach ($this->routes() as $url => $route) {
            if ($route['id'] == $id) {
                return $route;
            }
        }

        throw new \InvalidArgumentException(sprintf('No such route id found: %s', $id));
    }
public function getRoute ( string $ id ) : array { foreach ( $ this -> routes ( ) as $ url => $ route ) { if ( $ route [ 'id' ] == $ id ) { return $ route ; } } throw new \ InvalidArgumentException ( sprintf ( 'No such route id found: %s' , $ id ) ) ; }
Returns a single route definition.

Note: If no route ID was specified in routes.yaml then it will not be possible
to look up a route by ID.

@param string $id
The ID of the route to load.
@return array
The route definition.  The generated URL of the route is added as a "url" key.
@throws \InvalidArgumentException
If there is no route by that ID, an exception is thrown.
Returns a single route definition .