original_string: protected function write($messages, $file)
      {
          $f = @fopen($file, 'a');
          if ($f === false)
          {
              throw new \Exception("Logfile $file is not writeable!");
          }
  
          foreach($messages as $msg)
          {
              fwrite($f, $msg);
          }
  
          fclose($f);
      }
code: protected function write($messages, $file)
      {
          $f = @fopen($file, 'a');
          if ($f === false)
          {
              throw new \Exception("Logfile $file is not writeable!");
          }
  
          foreach($messages as $msg)
          {
              fwrite($f, $msg);
          }
  
          fclose($f);
      }
code_tokens: protected function write ( $ messages , $ file ) { $ f = @ fopen ( $ file , 'a' ) ; if ( $ f === false ) { throw new \ Exception ( "Logfile $file is not writeable!" ) ; } foreach ( $ messages as $ msg ) { fwrite ( $ f , $ msg ) ; } fclose ( $ f ) ; }
docstring: Write text to file
  
  @param array $messages
  @param string $file
  
  @throws Exception
docstring_tokens: Write text to file