private static function fixLocation(string $schemaSource, string $xmlUri): string
    {
        $newPath = \dirname(__DIR__, 1) . \DIRECTORY_SEPARATOR . 'Resource' . \DIRECTORY_SEPARATOR . 'schemas' . \DIRECTORY_SEPARATOR . 'xliff-core' . \DIRECTORY_SEPARATOR . 'xml.xsd';
        $parts   = \explode(\DIRECTORY_SEPARATOR, $newPath);

        if (\mb_stripos($newPath, 'phar://') === 0 && ($tmpFile = \tempnam(\sys_get_temp_dir(), 'narrowspark')) !== false) {
            \copy($newPath, $tmpFile);

            $parts = \explode(\DIRECTORY_SEPARATOR, $tmpFile);
        }

        $drive   = '\\' === \DIRECTORY_SEPARATOR ? \array_shift($parts) . '/' : '';
        $newPath = 'file:///' . $drive . \implode('/', \array_map('rawurlencode', $parts));

        return \str_replace($xmlUri, $newPath, $schemaSource);
    }
private static function fixLocation(string $schemaSource, string $xmlUri): string
    {
        $newPath = \dirname(__DIR__, 1) . \DIRECTORY_SEPARATOR . 'Resource' . \DIRECTORY_SEPARATOR . 'schemas' . \DIRECTORY_SEPARATOR . 'xliff-core' . \DIRECTORY_SEPARATOR . 'xml.xsd';
        $parts   = \explode(\DIRECTORY_SEPARATOR, $newPath);

        if (\mb_stripos($newPath, 'phar://') === 0 && ($tmpFile = \tempnam(\sys_get_temp_dir(), 'narrowspark')) !== false) {
            \copy($newPath, $tmpFile);

            $parts = \explode(\DIRECTORY_SEPARATOR, $tmpFile);
        }

        $drive   = '\\' === \DIRECTORY_SEPARATOR ? \array_shift($parts) . '/' : '';
        $newPath = 'file:///' . $drive . \implode('/', \array_map('rawurlencode', $parts));

        return \str_replace($xmlUri, $newPath, $schemaSource);
    }
private static function fixLocation ( string $ schemaSource , string $ xmlUri ) : string { $ newPath = \ dirname ( __DIR__ , 1 ) . \ DIRECTORY_SEPARATOR . 'Resource' . \ DIRECTORY_SEPARATOR . 'schemas' . \ DIRECTORY_SEPARATOR . 'xliff-core' . \ DIRECTORY_SEPARATOR . 'xml.xsd' ; $ parts = \ explode ( \ DIRECTORY_SEPARATOR , $ newPath ) ; if ( \ mb_stripos ( $ newPath , 'phar://' ) === 0 && ( $ tmpFile = \ tempnam ( \ sys_get_temp_dir ( ) , 'narrowspark' ) ) !== false ) { \ copy ( $ newPath , $ tmpFile ) ; $ parts = \ explode ( \ DIRECTORY_SEPARATOR , $ tmpFile ) ; } $ drive = '\\' === \ DIRECTORY_SEPARATOR ? \ array_shift ( $ parts ) . '/' : '' ; $ newPath = 'file:///' . $ drive . \ implode ( '/' , \ array_map ( 'rawurlencode' , $ parts ) ) ; return \ str_replace ( $ xmlUri , $ newPath , $ schemaSource ) ; }
Internally changes the URI of a dependent xsd to be loaded locally.

@param string $schemaSource Current content of schema file
@param string $xmlUri       External URI of XML to convert to local

@return string
Internally changes the URI of a dependent xsd to be loaded locally .