@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * |
62 | 62 | * @param array $arguments Options that influence the construction of the XML document. |
63 | 63 | * |
64 | - * @return FluidXml A new FluidXml instance. |
|
64 | + * @return FluidContext A new FluidXml instance. |
|
65 | 65 | */ |
66 | 66 | function fluidify(...$arguments) |
67 | 67 | { |
@@ -140,12 +140,16 @@ discard block |
||
140 | 140 | * $xml->query("/doc")->query("book[@id='123']"); |
141 | 141 | * ``` |
142 | 142 | * |
143 | - * @param string $xpath The XPath to execute. |
|
143 | + * @param string[] $xpath The XPath to execute. |
|
144 | 144 | * |
145 | 145 | * @return FluidContext The context associated to the DOMNodeList. |
146 | 146 | */ |
147 | 147 | public function query(...$xpath); |
148 | 148 | public function times($times, callable $fn = null); |
149 | + |
|
150 | + /** |
|
151 | + * @return FluidContext |
|
152 | + */ |
|
149 | 153 | public function each(callable $fn); |
150 | 154 | |
151 | 155 | /** |
@@ -162,9 +166,6 @@ discard block |
||
162 | 166 | * ``` |
163 | 167 | * |
164 | 168 | * @param string|array $child The child/children to add. |
165 | - * @param string $value The child text content. |
|
166 | - * @param bool $switchContext Whether to return the current context |
|
167 | - * or the context of the created node. |
|
168 | 169 | * |
169 | 170 | * @return FluidContext The context associated to the DOMNodeList. |
170 | 171 | */ |
@@ -179,6 +180,10 @@ discard block |
||
179 | 180 | public function remove(...$xpath); |
180 | 181 | public function xml($strip = false); |
181 | 182 | // Aliases: |
183 | + |
|
184 | + /** |
|
185 | + * @return FluidContext |
|
186 | + */ |
|
182 | 187 | public function add($child, ...$optionals); |
183 | 188 | public function prepend($sibling, ...$optionals); |
184 | 189 | public function insertSiblingBefore($sibling, ...$optionals); |
@@ -513,6 +518,10 @@ discard block |
||
513 | 518 | return new FluidContext($context, $this->namespaces); |
514 | 519 | } |
515 | 520 | |
521 | + /** |
|
522 | + * @param FluidContext $help_context |
|
523 | + * @param FluidContext $new_context |
|
524 | + */ |
|
516 | 525 | protected function chooseContext($help_context, $new_context) |
517 | 526 | { |
518 | 527 | // If the two contextes are diffent, the user has requested |
@@ -1014,6 +1023,10 @@ discard block |
||
1014 | 1023 | throw new \Exception('XML document not supported.'); |
1015 | 1024 | } |
1016 | 1025 | |
1026 | + /** |
|
1027 | + * @param string $name |
|
1028 | + * @param string $value |
|
1029 | + */ |
|
1017 | 1030 | protected function createElement($name, $value = null) |
1018 | 1031 | { |
1019 | 1032 | // The DOMElement instance must be different for every node, |
@@ -1342,6 +1355,9 @@ discard block |
||
1342 | 1355 | private $context; |
1343 | 1356 | private $times; |
1344 | 1357 | |
1358 | + /** |
|
1359 | + * @param FluidContext $context |
|
1360 | + */ |
|
1345 | 1361 | public function __construct($context, $times) |
1346 | 1362 | { |
1347 | 1363 | $this->context = $context; |