Lines Matching refs:sibling
74 * Inserts the $sibling node after $this
76 public function insertAfter(Node $sibling): void
78 $sibling->detach();
79 $sibling->next = $this->next;
81 if ($sibling->next) {
82 $sibling->next->previous = $sibling;
85 $sibling->previous = $this;
86 $this->next = $sibling;
87 $sibling->setParent($this->parent);
89 if (! $sibling->next && $sibling->parent) {
90 $sibling->parent->lastChild = $sibling;
95 * Inserts the $sibling node before $this
97 public function insertBefore(Node $sibling): void
99 $sibling->detach();
100 $sibling->previous = $this->previous;
102 if ($sibling->previous) {
103 $sibling->previous->next = $sibling;
106 $sibling->next = $this;
107 $this->previous = $sibling;
108 $sibling->setParent($this->parent);
110 if (! $sibling->previous && $sibling->parent) {
111 $sibling->parent->firstChild = $sibling;