Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 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);
     }
 }