@@ -84,34 +84,34 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | - * Evaluate and return the result of a given XPath expression using this element as context node |
|
88 | - * |
|
89 | - * @param string $expr XPath expression |
|
90 | - * @return mixed |
|
91 | - */ |
|
87 | + * Evaluate and return the result of a given XPath expression using this element as context node |
|
88 | + * |
|
89 | + * @param string $expr XPath expression |
|
90 | + * @return mixed |
|
91 | + */ |
|
92 | 92 | public function evaluate(string $expr) |
93 | 93 | { |
94 | 94 | return $this->ownerDocument->evaluate($expr, $this); |
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | - * Evaluate and return the first element of a given XPath query using this element as context node |
|
99 | - * |
|
100 | - * @param string $expr XPath expression |
|
101 | - * @return DOMNode|null |
|
102 | - */ |
|
98 | + * Evaluate and return the first element of a given XPath query using this element as context node |
|
99 | + * |
|
100 | + * @param string $expr XPath expression |
|
101 | + * @return DOMNode|null |
|
102 | + */ |
|
103 | 103 | public function firstOf(string $expr): ?DOMNode |
104 | 104 | { |
105 | 105 | return $this->ownerDocument->firstOf($expr, $this); |
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Insert given element relative to this element's position |
|
110 | - * |
|
111 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
112 | - * @param self $element |
|
113 | - * @return self |
|
114 | - */ |
|
109 | + * Insert given element relative to this element's position |
|
110 | + * |
|
111 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
112 | + * @param self $element |
|
113 | + * @return self |
|
114 | + */ |
|
115 | 115 | public function insertAdjacentElement(string $where, self $element): self |
116 | 116 | { |
117 | 117 | $this->insertAdjacentNode($where, $element); |
@@ -120,24 +120,24 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
123 | - * Insert given text relative to this element's position |
|
124 | - * |
|
125 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
126 | - * @param string $text |
|
127 | - * @return void |
|
128 | - */ |
|
123 | + * Insert given text relative to this element's position |
|
124 | + * |
|
125 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
126 | + * @param string $text |
|
127 | + * @return void |
|
128 | + */ |
|
129 | 129 | public function insertAdjacentText(string $where, string $text): void |
130 | 130 | { |
131 | 131 | $this->insertAdjacentXML($where, htmlspecialchars($text, ENT_XML1)); |
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
135 | - * Insert given XML relative to this element's position |
|
136 | - * |
|
137 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
138 | - * @param string $xml |
|
139 | - * @return void |
|
140 | - */ |
|
135 | + * Insert given XML relative to this element's position |
|
136 | + * |
|
137 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
138 | + * @param string $xml |
|
139 | + * @return void |
|
140 | + */ |
|
141 | 141 | public function insertAdjacentXML(string $where, string $xml): void |
142 | 142 | { |
143 | 143 | $fragment = $this->ownerDocument->createDocumentFragment(); |
@@ -147,32 +147,32 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
150 | - * Evaluate and return the result of a given XPath query using this element as context node |
|
151 | - * |
|
152 | - * @param string $expr XPath expression |
|
153 | - * @return DOMNodeList |
|
154 | - */ |
|
150 | + * Evaluate and return the result of a given XPath query using this element as context node |
|
151 | + * |
|
152 | + * @param string $expr XPath expression |
|
153 | + * @return DOMNodeList |
|
154 | + */ |
|
155 | 155 | public function query(string $expr): DOMNodeList |
156 | 156 | { |
157 | 157 | return $this->ownerDocument->query($expr, $this); |
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
161 | - * Remove this element from the document |
|
162 | - * |
|
163 | - * @return void |
|
164 | - */ |
|
161 | + * Remove this element from the document |
|
162 | + * |
|
163 | + * @return void |
|
164 | + */ |
|
165 | 165 | public function remove(): void |
166 | 166 | { |
167 | 167 | $this->parentNode->removeChild($this); |
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
171 | - * Replace this element with given nodes/text |
|
172 | - * |
|
173 | - * @param DOMNode|string $nodes |
|
174 | - * @return void |
|
175 | - */ |
|
171 | + * Replace this element with given nodes/text |
|
172 | + * |
|
173 | + * @param DOMNode|string $nodes |
|
174 | + * @return void |
|
175 | + */ |
|
176 | 176 | public function replaceWith(...$nodes): void |
177 | 177 | { |
178 | 178 | foreach ($nodes as $node) |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
190 | - * Add namespace declarations that may be missing in given XML |
|
191 | - * |
|
192 | - * @param string $xml Original XML |
|
193 | - * @return string Modified XML |
|
194 | - */ |
|
190 | + * Add namespace declarations that may be missing in given XML |
|
191 | + * |
|
192 | + * @param string $xml Original XML |
|
193 | + * @return string Modified XML |
|
194 | + */ |
|
195 | 195 | protected function addMissingNamespaceDeclarations(string $xml): string |
196 | 196 | { |
197 | 197 | preg_match_all('(xmlns:\\K[-\\w]++(?==))', $xml, $m); |
@@ -216,12 +216,12 @@ discard block |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
219 | - * Insert given node relative to this element's position |
|
220 | - * |
|
221 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
222 | - * @param DOMNode $node |
|
223 | - * @return void |
|
224 | - */ |
|
219 | + * Insert given node relative to this element's position |
|
220 | + * |
|
221 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
222 | + * @param DOMNode $node |
|
223 | + * @return void |
|
224 | + */ |
|
225 | 225 | protected function insertAdjacentNode(string $where, DOMNode $node): void |
226 | 226 | { |
227 | 227 | $where = strtolower($where); |