public static function removeEmptySegments($uri)
    {
        $uri = self::filterUri($uri);

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

        return self::normalizePath($uri, (new HierarchicalPath($uri->getPath()))->withoutEmptySegments());
    }
public static function removeEmptySegments ( $ uri ) { $ uri = self :: filterUri ( $ uri ) ; return self :: normalizePath ( $ uri , ( new HierarchicalPath ( $ uri -> getPath ( ) ) ) -> withoutEmptySegments ( ) ) ; }
Remove empty segments from the URI path.

@return Psr7UriInterface|UriInterface
Remove empty segments from the URI path .