19declare(strict_types=1);
33 if ($el instanceof DOMDocument) {
34 $root = $el->documentElement;
35 } elseif ($el instanceof DOMElement) {
38 throw new InvalidArgumentException(
'Invalid arguments, expected DOMElement or DOMDocument');
41 $this->nodeList = $root->childNodes;
49 public function next(): void
56 return $this->nodeList->item($this->position);
61 return $this->position < $this->nodeList->length;
71 return $this->
current()->hasChildNodes();
76 return new self($this->
current());
Class ilHtmlDomNodeIterator.
readonly DOMNodeList $nodeList