original_string: public function generate(array $ast) : string
      {
          $this->traverser->traverse($ast);
  
          $generatedCode = parent::generate($ast);
          $className     = trim($this->visitor->getNamespace() . '\\' . $this->visitor->getName(), '\\');
          $fileName      = $this->fileLocator->getGeneratedClassFileName($className);
          $tmpFileName   = $fileName . '.' . uniqid('', true);
  
          // renaming files is necessary to avoid race conditions when the same file is written multiple times
          // in a short time period
          file_put_contents($tmpFileName, "<?php\n\n" . $generatedCode);
          rename($tmpFileName, $fileName);
  
          return $generatedCode;
      }
code: public function generate(array $ast) : string
      {
          $this->traverser->traverse($ast);
  
          $generatedCode = parent::generate($ast);
          $className     = trim($this->visitor->getNamespace() . '\\' . $this->visitor->getName(), '\\');
          $fileName      = $this->fileLocator->getGeneratedClassFileName($className);
          $tmpFileName   = $fileName . '.' . uniqid('', true);
  
          // renaming files is necessary to avoid race conditions when the same file is written multiple times
          // in a short time period
          file_put_contents($tmpFileName, "<?php\n\n" . $generatedCode);
          rename($tmpFileName, $fileName);
  
          return $generatedCode;
      }
code_tokens: public function generate ( array $ ast ) : string { $ this -> traverser -> traverse ( $ ast ) ; $ generatedCode = parent :: generate ( $ ast ) ; $ className = trim ( $ this -> visitor -> getNamespace ( ) . '\\' . $ this -> visitor -> getName ( ) , '\\' ) ; $ fileName = $ this -> fileLocator -> getGeneratedClassFileName ( $ className ) ; $ tmpFileName = $ fileName . '.' . uniqid ( '' , true ) ; // renaming files is necessary to avoid race conditions when the same file is written multiple times // in a short time period file_put_contents ( $ tmpFileName , "<?php\n\n" . $ generatedCode ) ; rename ( $ tmpFileName , $ fileName ) ; return $ generatedCode ; }
docstring: Write generated code to disk and return the class code
  
  {@inheritDoc}
  
  @throws \CodeGenerationUtils\Visitor\Exception\UnexpectedValueException
docstring_tokens: Write generated code to disk and return the class code