public static function replaceDirname($uri, $path)
    {
        $uri = self::filterUri($uri);

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

        return self::normalizePath($uri, (new HierarchicalPath($uri->getPath()))->withDirname($path));
    }
public static function replaceDirname ( $ uri , $ path ) { $ uri = self :: filterUri ( $ uri ) ; return self :: normalizePath ( $ uri , ( new HierarchicalPath ( $ uri -> getPath ( ) ) ) -> withDirname ( $ path ) ) ; }
Replace the URI path dirname.

@return Psr7UriInterface|UriInterface
Replace the URI path dirname .