public function setText($text) { $nl = FormatterFactory::getDefaultFormatter()->getConfig('nl'); $this->newlineCount = substr_count($text, $nl); return parent::setText($text); }