src/Router/TreeRouter.php
protected function indexRoute(Route $route): void
    {
        $currentBranch = $this->tree;
        $patternParts = $route->getPatternParts();

        foreach( $patternParts as $pattern ){
            $currentBranch = $currentBranch->next($pattern);
        }

        $currentBranch->addRoute($route);
    }
protected function indexRoute(Route $route): void
    {
        $currentBranch = $this->tree;
        $patternParts = $route->getPatternParts();

        foreach( $patternParts as $pattern ){
            $currentBranch = $currentBranch->next($pattern);
        }

        $currentBranch->addRoute($route);
    }
Index the route.

@param Route $route
@return void