public static function addLeadingSlash($uri)
    {
        $uri = self::filterUri($uri);
        $path = $uri->getPath();
        if ('/' !== ($path[0] ?? '')) {
            $path = '/'.$path;
        }

        return self::normalizePath($uri, $path);
    }
public static function addLeadingSlash($uri)
    {
        $uri = self::filterUri($uri);
        $path = $uri->getPath();
        if ('/' !== ($path[0] ?? '')) {
            $path = '/'.$path;
        }

        return self::normalizePath($uri, $path);
    }
public static function addLeadingSlash ( $ uri ) { $ uri = self :: filterUri ( $ uri ) ; $ path = $ uri -> getPath ( ) ; if ( '/' !== ( $ path [ 0 ] ?? '' ) ) { $ path = '/' . $ path ; } return self :: normalizePath ( $ uri , $ path ) ; }
Add a leading slash to the URI path.

@return Psr7UriInterface|UriInterface
Add a leading slash to the URI path .