public function popElement() { if ($this->nextElement->getName() != $this->element->getName()) { throw new \Exception("Unmatched elements: {$this->element->getName()} and {$this->nextElement->getName()}"); } $this->element->setHasClosingTag(true); $this->element = $this->element->getParent(); $this->reset(); }
private function removeSiblingProperties(Element $child, $key) { /** @var Liste $siblings */ $siblings = $child->getParent()->getChildren(); $index = $siblings->indexOf($child); while ($siblings->isInBound($index)) { $child = $siblings->get($index); if (!$child instanceof Element) { $index++; continue; } else { if (!($this->isProperty($child) && $this->getPropertyName($child) == $key)) { break; } } $siblings->remove($index); } }