@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | - * |
|
| 110 | - * |
|
| 111 | - * @return self |
|
| 112 | - */ |
|
| 109 | + * |
|
| 110 | + * |
|
| 111 | + * @return self |
|
| 112 | + */ |
|
| 113 | 113 | protected function insertElement(string $nodeName, string $where, string $text): self |
| 114 | 114 | { |
| 115 | 115 | $pos = strpos($nodeName, ':'); |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | - * |
|
| 132 | - * |
|
| 133 | - * @return self |
|
| 134 | - */ |
|
| 131 | + * |
|
| 132 | + * |
|
| 133 | + * @return self |
|
| 134 | + */ |
|
| 135 | 135 | protected function insertXslElement(string $localName, string $where, array $arguments): self |
| 136 | 136 | { |
| 137 | 137 | $callback = [$this->ownerDocument, 'create' . $localName]; |
@@ -146,34 +146,34 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
| 149 | - * Evaluate and return the result of a given XPath expression using this element as context node |
|
| 150 | - * |
|
| 151 | - * @param string $expr XPath expression |
|
| 152 | - * @return mixed |
|
| 153 | - */ |
|
| 149 | + * Evaluate and return the result of a given XPath expression using this element as context node |
|
| 150 | + * |
|
| 151 | + * @param string $expr XPath expression |
|
| 152 | + * @return mixed |
|
| 153 | + */ |
|
| 154 | 154 | public function evaluate(string $expr) |
| 155 | 155 | { |
| 156 | 156 | return $this->ownerDocument->evaluate($expr, $this); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | - * Evaluate and return the first element of a given XPath query using this element as context node |
|
| 161 | - * |
|
| 162 | - * @param string $expr XPath expression |
|
| 163 | - * @return DOMNode|null |
|
| 164 | - */ |
|
| 160 | + * Evaluate and return the first element of a given XPath query using this element as context node |
|
| 161 | + * |
|
| 162 | + * @param string $expr XPath expression |
|
| 163 | + * @return DOMNode|null |
|
| 164 | + */ |
|
| 165 | 165 | public function firstOf(string $expr): ?DOMNode |
| 166 | 166 | { |
| 167 | 167 | return $this->ownerDocument->firstOf($expr, $this); |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | - * Insert given element relative to this element's position |
|
| 172 | - * |
|
| 173 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 174 | - * @param self $element |
|
| 175 | - * @return self |
|
| 176 | - */ |
|
| 171 | + * Insert given element relative to this element's position |
|
| 172 | + * |
|
| 173 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 174 | + * @param self $element |
|
| 175 | + * @return self |
|
| 176 | + */ |
|
| 177 | 177 | public function insertAdjacentElement(string $where, self $element): self |
| 178 | 178 | { |
| 179 | 179 | $this->insertAdjacentNode($where, $element); |
@@ -182,24 +182,24 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | - * Insert given text relative to this element's position |
|
| 186 | - * |
|
| 187 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 188 | - * @param string $text |
|
| 189 | - * @return void |
|
| 190 | - */ |
|
| 185 | + * Insert given text relative to this element's position |
|
| 186 | + * |
|
| 187 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 188 | + * @param string $text |
|
| 189 | + * @return void |
|
| 190 | + */ |
|
| 191 | 191 | public function insertAdjacentText(string $where, string $text): void |
| 192 | 192 | { |
| 193 | 193 | $this->insertAdjacentNode($where, $this->ownerDocument->createTextNode($text)); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
| 197 | - * Insert given XML relative to this element's position |
|
| 198 | - * |
|
| 199 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 200 | - * @param string $xml |
|
| 201 | - * @return void |
|
| 202 | - */ |
|
| 197 | + * Insert given XML relative to this element's position |
|
| 198 | + * |
|
| 199 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 200 | + * @param string $xml |
|
| 201 | + * @return void |
|
| 202 | + */ |
|
| 203 | 203 | public function insertAdjacentXML(string $where, string $xml): void |
| 204 | 204 | { |
| 205 | 205 | $fragment = $this->ownerDocument->createDocumentFragment(); |
@@ -209,32 +209,32 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | - * Evaluate and return the result of a given XPath query using this element as context node |
|
| 213 | - * |
|
| 214 | - * @param string $expr XPath expression |
|
| 215 | - * @return DOMNodeList |
|
| 216 | - */ |
|
| 212 | + * Evaluate and return the result of a given XPath query using this element as context node |
|
| 213 | + * |
|
| 214 | + * @param string $expr XPath expression |
|
| 215 | + * @return DOMNodeList |
|
| 216 | + */ |
|
| 217 | 217 | public function query(string $expr): DOMNodeList |
| 218 | 218 | { |
| 219 | 219 | return $this->ownerDocument->query($expr, $this); |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
| 223 | - * Remove this element from the document |
|
| 224 | - * |
|
| 225 | - * @return void |
|
| 226 | - */ |
|
| 223 | + * Remove this element from the document |
|
| 224 | + * |
|
| 225 | + * @return void |
|
| 226 | + */ |
|
| 227 | 227 | public function remove(): void |
| 228 | 228 | { |
| 229 | 229 | $this->parentNode->removeChild($this); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
| 233 | - * Replace this element with given nodes/text |
|
| 234 | - * |
|
| 235 | - * @param DOMNode|string $nodes |
|
| 236 | - * @return void |
|
| 237 | - */ |
|
| 233 | + * Replace this element with given nodes/text |
|
| 234 | + * |
|
| 235 | + * @param DOMNode|string $nodes |
|
| 236 | + * @return void |
|
| 237 | + */ |
|
| 238 | 238 | public function replaceWith(...$nodes): void |
| 239 | 239 | { |
| 240 | 240 | foreach ($nodes as $node) |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
| 252 | - * Add namespace declarations that may be missing in given XML |
|
| 253 | - * |
|
| 254 | - * @param string $xml Original XML |
|
| 255 | - * @return string Modified XML |
|
| 256 | - */ |
|
| 252 | + * Add namespace declarations that may be missing in given XML |
|
| 253 | + * |
|
| 254 | + * @param string $xml Original XML |
|
| 255 | + * @return string Modified XML |
|
| 256 | + */ |
|
| 257 | 257 | protected function addMissingNamespaceDeclarations(string $xml): string |
| 258 | 258 | { |
| 259 | 259 | preg_match_all('(xmlns:\\K[-\\w]++(?==))', $xml, $m); |
@@ -278,12 +278,12 @@ discard block |
||
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | /** |
| 281 | - * Insert given node relative to this element's position |
|
| 282 | - * |
|
| 283 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 284 | - * @param DOMNode $node |
|
| 285 | - * @return void |
|
| 286 | - */ |
|
| 281 | + * Insert given node relative to this element's position |
|
| 282 | + * |
|
| 283 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 284 | + * @param DOMNode $node |
|
| 285 | + * @return void |
|
| 286 | + */ |
|
| 287 | 287 | protected function insertAdjacentNode(string $where, DOMNode $node): void |
| 288 | 288 | { |
| 289 | 289 | $where = strtolower($where); |