Writes a line to the file.

@param string $string  The string to write
@param bool   $format  Format the string
198986
protected function write($string, $format = true)
    {
        if ($format) {
            $string .= $this->delimiter;
        }

        $string .= "\n";

        if (fwrite($this->file, $string, strlen($string)) === false) {
            throw new Exception('Unable to write '.strlen($string).' bytes to the dumpfile.');
        }
    }
168711
public function write($format = 'rtf')
	{
		$string = '';
		
		// if $format is a string
		if (is_string($format)) {
			$writer = new Writer();
			$string = $writer->write($this->root, $format);	
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, format, to be a string"
			);
		}
		
		return $string;
	}
1229555
public function formatExp($string, $format = null)
	{
		if ($format === null)
		{
			$format = isset($this->config['exp']) ? $this->config['exp'] : '00-00';
		}

		return $this->format($string, $format);
	}
858382
@Override
	public void write(final String string, final int off, final int len) {
		for (int i = off; i < off + len; i++) {
			write(string.charAt(i));
		}
	}
379680
public function write($content)
    {
        if ($this->new_line) {
            $content .= PHP_EOL;
        }

        foreach ($this->getCurrentWriters() as $writer) {
            $writer->write($content);
        }

        $this->resetOneTimers();
    }
929780
public function setFormat($format)
    {
        $this->format = $format;
        if ($this->format === self::FORMAT_UNIX) {
            $this->newline = "\n";
        } elseif ($this->format === self::FORMAT_DOS) {
            $this->newline = "\r\n";
        }
    }
582813
public function write($string)
    {
        if ($this->fd) {
            $ret = fwrite($this->fd, $string);
            if ($ret !== FALSE) {
                return $ret; 
            }
        }

        return false;
    }
1254115
public function formatLine(string $format, array $item, array $style = [])
    {
        foreach ($item as $key => $value) {
            $value = (isset($style[$key]) && ! empty($style[$key])) ?
                    "<{$style[$key]}>{$value}</>" :
                    $value;
            $format = str_replace("<{$key}>", $value, $format);
        }

        $this->output->writeln($format);
    }
1101056
public function set($string)
    {
        $this->clear();

        fwrite($this->stream, $string);
        rewind($this->stream);
    }
7090
public function write($string)
    {
        $handle = @fopen($this->filePath, $this->mode);
        if ($handle === false) {
            return $handle;
        }
        return @fwrite($handle, $string);


    }
980545
private function outputLine($string, $token)
    {
        $this->output($string, $token);
        $this->newLine = true;
    }
158388
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;
    }
1129213
private function write( string$content )
	{
		$this->raw.= $content;

		fwrite( $this->handle, $content );
	}
536
protected function write(string $data)
    {
        $this->clearTimeout();
        $this->conn->write($data . static::NEW_LINE);
        $this->log('<-' . $data);
        $this->setTimeout();
    }
1321385
public function write($message, $newLine = false, $formatType = self::OUTPUT_NORMAL) {
        if ($formatType === self::OUTPUT_NORMAL) {
            $message = $this->getFormatter()->format($message);
        }

        if ($newLine) {
            $message .= \PHP_EOL;
        }
        return \fwrite($this->stream, $message);
    }
414703
public function write($string)
    {
        $chunked = $this->getChunkedString($string);
        $this->position += strlen($chunked);
        return $this->stream->write($chunked);
    }
1349025
protected function log_line($string) {

        if (!PHPUNIT_TEST) {
            mtrace($string);
        }
        if ($this->logfp) {
            fwrite($this->logfp, $string . "\n");
        }
    }