public static function prependSegment($uri, $segment)
    {
        $uri = self::filterUri($uri);

        return self::normalizePath($uri, (new HierarchicalPath($uri->getPath()))->prepend($segment));
    }
public static function prependSegment($uri, $segment)
    {
        $uri = self::filterUri($uri);

        return self::normalizePath($uri, (new HierarchicalPath($uri->getPath()))->prepend($segment));
    }
public static function prependSegment ( $ uri , $ segment ) { $ uri = self :: filterUri ( $ uri ) ; return self :: normalizePath ( $ uri , ( new HierarchicalPath ( $ uri -> getPath ( ) ) ) -> prepend ( $ segment ) ) ; }
Prepend an new segment or a new path to the URI path.

@return Psr7UriInterface|UriInterface
Prepend an new segment or a new path to the URI path .