public function rtrim() { $addNl = "\n" === substr($this->content, -1); $this->content = rtrim($this->content); if ($addNl) { $this->content .= "\n"; } return $this; }
/** * @return void */ protected function ensureBlankLine() { if (!$this->writer->endsWith("\n\n") && strlen($this->writer->rtrim()->getContent()) > 0) { $this->writer->writeln(); } }