original_string: public function replace($path, $content)
      {
          // If the path already exists and is a symlink, get the real path...
          clearstatcache(true, $path);
  
          $path = realpath($path) ?: $path;
  
          $tempPath = tempnam(dirname($path), basename($path));
  
          // Fix permissions of tempPath because `tempnam()` creates it with permissions set to 0600...
          chmod($tempPath, 0777 - umask());
  
          file_put_contents($tempPath, $content);
  
          rename($tempPath, $path);
      }
code: public function replace($path, $content)
      {
          // If the path already exists and is a symlink, get the real path...
          clearstatcache(true, $path);
  
          $path = realpath($path) ?: $path;
  
          $tempPath = tempnam(dirname($path), basename($path));
  
          // Fix permissions of tempPath because `tempnam()` creates it with permissions set to 0600...
          chmod($tempPath, 0777 - umask());
  
          file_put_contents($tempPath, $content);
  
          rename($tempPath, $path);
      }
code_tokens: public function replace ( $ path , $ content ) { // If the path already exists and is a symlink, get the real path... clearstatcache ( true , $ path ) ; $ path = realpath ( $ path ) ? : $ path ; $ tempPath = tempnam ( dirname ( $ path ) , basename ( $ path ) ) ; // Fix permissions of tempPath because `tempnam()` creates it with permissions set to 0600... chmod ( $ tempPath , 0777 - umask ( ) ) ; file_put_contents ( $ tempPath , $ content ) ; rename ( $ tempPath , $ path ) ; }
docstring: Write the contents of a file, replacing it atomically if it already exists.
  
  @param  string  $path
  @param  string  $content
  @return void
docstring_tokens: Write the contents of a file replacing it atomically if it already exists .