@@ -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,22 +147,22 @@ 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 | - * Add namespace declarations that may be missing in given XML |
|
| 162 | - * |
|
| 163 | - * @param string $xml Original XML |
|
| 164 | - * @return string Modified XML |
|
| 165 | - */ |
|
| 161 | + * Add namespace declarations that may be missing in given XML |
|
| 162 | + * |
|
| 163 | + * @param string $xml Original XML |
|
| 164 | + * @return string Modified XML |
|
| 165 | + */ |
|
| 166 | 166 | protected function addMissingNamespaceDeclarations(string $xml): string |
| 167 | 167 | { |
| 168 | 168 | preg_match_all('(xmlns:\\K[-\\w]++(?==))', $xml, $m); |
@@ -187,12 +187,12 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | - * Insert given node relative to this element's position |
|
| 191 | - * |
|
| 192 | - * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 193 | - * @param DOMNode $node |
|
| 194 | - * @return void |
|
| 195 | - */ |
|
| 190 | + * Insert given node relative to this element's position |
|
| 191 | + * |
|
| 192 | + * @param string $where One of 'beforebegin', 'afterbegin', 'beforeend', 'afterend' |
|
| 193 | + * @param DOMNode $node |
|
| 194 | + * @return void |
|
| 195 | + */ |
|
| 196 | 196 | protected function insertAdjacentNode(string $where, DOMNode $node): void |
| 197 | 197 | { |
| 198 | 198 | $where = strtolower($where); |