original_string: private static function fixXmlLocation(string $schemaSource, string $xmlUri): string
      {
          $newPath = str_replace('\\', '/', __DIR__).'/../Resources/schemas/xml.xsd';
          $parts = explode('/', $newPath);
          $locationstart = 'file:///';
          if (0 === stripos($newPath, 'phar://')) {
              $tmpfile = tempnam(sys_get_temp_dir(), 'symfony');
              if ($tmpfile) {
                  copy($newPath, $tmpfile);
                  $parts = explode('/', str_replace('\\', '/', $tmpfile));
              } else {
                  array_shift($parts);
                  $locationstart = 'phar:///';
              }
          }
  
          $drive = '\\' === \DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
          $newPath = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
  
          return str_replace($xmlUri, $newPath, $schemaSource);
      }
code: private static function fixXmlLocation(string $schemaSource, string $xmlUri): string
      {
          $newPath = str_replace('\\', '/', __DIR__).'/../Resources/schemas/xml.xsd';
          $parts = explode('/', $newPath);
          $locationstart = 'file:///';
          if (0 === stripos($newPath, 'phar://')) {
              $tmpfile = tempnam(sys_get_temp_dir(), 'symfony');
              if ($tmpfile) {
                  copy($newPath, $tmpfile);
                  $parts = explode('/', str_replace('\\', '/', $tmpfile));
              } else {
                  array_shift($parts);
                  $locationstart = 'phar:///';
              }
          }
  
          $drive = '\\' === \DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
          $newPath = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
  
          return str_replace($xmlUri, $newPath, $schemaSource);
      }
code_tokens: private static function fixXmlLocation ( string $ schemaSource , string $ xmlUri ) : string { $ newPath = str_replace ( '\\' , '/' , __DIR__ ) . '/../Resources/schemas/xml.xsd' ; $ parts = explode ( '/' , $ newPath ) ; $ locationstart = 'file:///' ; if ( 0 === stripos ( $ newPath , 'phar://' ) ) { $ tmpfile = tempnam ( sys_get_temp_dir ( ) , 'symfony' ) ; if ( $ tmpfile ) { copy ( $ newPath , $ tmpfile ) ; $ parts = explode ( '/' , str_replace ( '\\' , '/' , $ tmpfile ) ) ; } else { array_shift ( $ parts ) ; $ locationstart = 'phar:///' ; } } $ drive = '\\' === \ DIRECTORY_SEPARATOR ? array_shift ( $ parts ) . '/' : '' ; $ newPath = $ locationstart . $ drive . implode ( '/' , array_map ( 'rawurlencode' , $ parts ) ) ; return str_replace ( $ xmlUri , $ newPath , $ schemaSource ) ; }
docstring: Internally changes the URI of a dependent xsd to be loaded locally.
docstring_tokens: Internally changes the URI of a dependent xsd to be loaded locally .