gossi\codegen\generator\utils\Writer::write PHP Method

write() public method

public write ( string $content )
$content string
    public function write($content)
    {
        $lines = explode("\n", $content);
        for ($i = 0, $c = count($lines); $i < $c; $i++) {
            if ($this->indentationLevel > 0 && !empty($lines[$i]) && (empty($this->content) || "\n" === substr($this->content, -1))) {
                $this->content .= str_repeat($this->indentation, $this->indentationLevel);
            }
            $this->content .= $lines[$i];
            if ($i + 1 < $c) {
                $this->content .= "\n";
            }
        }
        return $this;
    }