public static function replaceExtension($uri, $extension)
    {
        $uri = self::filterUri($uri);

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

        return self::normalizePath($uri, (new HierarchicalPath($uri->getPath()))->withExtension($extension));
    }
public static function replaceExtension ( $ uri , $ extension ) { $ uri = self :: filterUri ( $ uri ) ; return self :: normalizePath ( $ uri , ( new HierarchicalPath ( $ uri -> getPath ( ) ) ) -> withExtension ( $ extension ) ) ; }
Replace the URI path basename extension.

@return Psr7UriInterface|UriInterface
Replace the URI path basename extension .