+
+ protected function getCurrentElement(): DOMElement {
+ return $this->nodes[$this->position];
+ }
+
+ private function importNodes(DOMNodeList $nodeList): void {
+ foreach ($nodeList as $node) {
+ if (!$node instanceof DOMElement) {
+ throw new ElementCollectionException(
+ \sprintf('\DOMElement expected, got \%s', \get_class($node))
+ );
+ }
+
+ $this->nodes[] = $node;
+ }
+ }