Symfony\Component\Routing\RouteCollection::getRoot PHP Method

getRoot() public method

Gets the root RouteCollection of the tree.
public getRoot ( ) : RouteCollection
return RouteCollection The root RouteCollection
    public function getRoot()
    {
        $parent = $this;
        while ($parent->getParent()) {
            $parent = $parent->getParent();
        }

        return $parent;
    }