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;
    }
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;
    }
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 ; }
add string to file

@param       string      $string     file content
@return      FileWriterInterface
@throws      FileWriterException
add string to file