@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param array $arguments Options that influence the construction of the XML document. |
70 | 70 | * |
71 | - * @return FluidXml A new FluidXml instance. |
|
71 | + * @return FluidContext A new FluidXml instance. |
|
72 | 72 | */ |
73 | 73 | function fluidify(...$arguments) |
74 | 74 | { |
@@ -85,6 +85,9 @@ discard block |
||
85 | 85 | return new FluidNamespace(...$arguments); |
86 | 86 | } |
87 | 87 | |
88 | +/** |
|
89 | + * @param string $string |
|
90 | + */ |
|
88 | 91 | function is_an_xml_string($string) |
89 | 92 | { |
90 | 93 | // Removes any empty new line at the beginning, |
@@ -143,12 +146,16 @@ discard block |
||
143 | 146 | * $xml->query("/doc")->query("book[@id='123']"); |
144 | 147 | * ``` |
145 | 148 | * |
146 | - * @param string $xpath The XPath to execute. |
|
149 | + * @param string[] $xpath The XPath to execute. |
|
147 | 150 | * |
148 | 151 | * @return FluidContext The context associated to the DOMNodeList. |
149 | 152 | */ |
150 | 153 | public function query(...$xpath); |
151 | 154 | public function times($times, callable $fn = null); |
155 | + |
|
156 | + /** |
|
157 | + * @return FluidContext |
|
158 | + */ |
|
152 | 159 | public function each(callable $fn); |
153 | 160 | |
154 | 161 | /** |
@@ -165,9 +172,6 @@ discard block |
||
165 | 172 | * ``` |
166 | 173 | * |
167 | 174 | * @param string|array $child The child/children to add. |
168 | - * @param string $value The child text content. |
|
169 | - * @param bool $switchContext Whether to return the current context |
|
170 | - * or the context of the created node. |
|
171 | 175 | * |
172 | 176 | * @return FluidContext The context associated to the DOMNodeList. |
173 | 177 | */ |
@@ -182,6 +186,10 @@ discard block |
||
182 | 186 | public function remove(...$xpath); |
183 | 187 | public function xml($strip = false); |
184 | 188 | // Aliases: |
189 | + |
|
190 | + /** |
|
191 | + * @return FluidContext |
|
192 | + */ |
|
185 | 193 | public function add($child, ...$optionals); |
186 | 194 | public function prepend($sibling, ...$optionals); |
187 | 195 | public function insertSiblingBefore($sibling, ...$optionals); |
@@ -478,6 +486,10 @@ discard block |
||
478 | 486 | return new FluidContext($context, $this->namespaces); |
479 | 487 | } |
480 | 488 | |
489 | + /** |
|
490 | + * @param FluidContext $helpContext |
|
491 | + * @param FluidContext $newContext |
|
492 | + */ |
|
481 | 493 | protected function chooseContext($helpContext, $newContext) |
482 | 494 | { |
483 | 495 | // If the two contextes are diffent, the user has requested |
@@ -876,6 +888,10 @@ discard block |
||
876 | 888 | return new FluidContext($context, $this->namespaces); |
877 | 889 | } |
878 | 890 | |
891 | + /** |
|
892 | + * @param string $name |
|
893 | + * @param string $value |
|
894 | + */ |
|
879 | 895 | protected function createElement($name, $value = null) |
880 | 896 | { |
881 | 897 | // The DOMElement instance must be different for every node, |
@@ -1211,6 +1227,9 @@ discard block |
||
1211 | 1227 | protected $context; |
1212 | 1228 | protected $times; |
1213 | 1229 | |
1230 | + /** |
|
1231 | + * @param FluidContext $context |
|
1232 | + */ |
|
1214 | 1233 | public function __construct($context, $times) |
1215 | 1234 | { |
1216 | 1235 | $this->context = $context; |