= count($this->items)) $this->items[] = $item; else array_splice($this->items, $pos, 0, $item); } public function append(string $text) : self { if ($this->items && !$this->__text) $this->replace('[ul][li]' . implode('[/li][li]', $this->items) . '[/li][/ul]'); return parent::append($text); } public function __toString() : string { if ($this->items && !$this->__text) $this->replace('[ul][li]' . implode('[/li][li]', $this->items) . '[/li][/ul]'); return parent::__toString(); } public function getJsGlobals() : array { if ($this->items && !$this->__text) $this->replace('[ul][li]' . implode('[/li][li]', $this->items) . '[/li][/ul]'); return parent::getJsGlobals(); } } ?>