public function enterDoctype(Doctype $doctype) { $str = 'doctype('; $str .= $doctype->getDoctypeId() ?: 'default'; if ($options = $doctype->getOptions()) { $str .= ', ' . $options; } $str .= ')'; $this->write($str); }