original_string: public function writeLine($string)
      {
          $string = rtrim($string, "\n\r") . PHP_EOL;
          if ($this->getFileObject()->fwrite($string) === false) {
              // return written bytes or null on error
              throw new FileWriterException('write line to file failed.');
          }
          return $this;
      }
code: public function writeLine($string)
      {
          $string = rtrim($string, "\n\r") . PHP_EOL;
          if ($this->getFileObject()->fwrite($string) === false) {
              // return written bytes or null on error
              throw new FileWriterException('write line to file failed.');
          }
          return $this;
      }
code_tokens: public function writeLine ( $ string ) { $ string = rtrim ( $ string , "\n\r" ) . PHP_EOL ; if ( $ this -> getFileObject ( ) -> fwrite ( $ string ) === false ) { // return written bytes or null on error throw new FileWriterException ( 'write line to file failed.' ) ; } return $ this ; }
docstring: add string to file
  
  @param       string      $string     file content
  @return      FileWriterInterface
  @throws      FileWriterException
docstring_tokens: add string to file