src/Router/RouteBranch.php
public function next(string $uriPart): RouteBranch
    {
        foreach( $this->branches as $key => $branch ){
            
            if( $uriPart === $key ){
                return $branch;
            }
        }

        return $this->addBranch($uriPart);
    }
public function next(string $uriPart): RouteBranch
    {
        foreach( $this->branches as $key => $branch ){
            
            if( $uriPart === $key ){
                return $branch;
            }
        }

        return $this->addBranch($uriPart);
    }
Get the next branch or create a new one.

@param string $uriPart
@return RouteBranch