@@ -38,22 +38,22 @@ |
||
38 | 38 | $ds = \DIRECTORY_SEPARATOR; |
39 | 39 | |
40 | 40 | // First of all. |
41 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidInterface.php"; |
|
42 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidAliasesTrait.php"; |
|
43 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidSaveTrait.php"; |
|
44 | -require_once __DIR__ . "{$ds}FluidXml{$ds}NewableTrait.php"; |
|
45 | -require_once __DIR__ . "{$ds}FluidXml{$ds}ReservedCallStaticTrait.php"; |
|
46 | -require_once __DIR__ . "{$ds}FluidXml{$ds}ReservedCallTrait.php"; |
|
41 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidInterface.php"; |
|
42 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidAliasesTrait.php"; |
|
43 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidSaveTrait.php"; |
|
44 | +require_once __DIR__ . "{$ds}fluidxml{$ds}NewableTrait.php"; |
|
45 | +require_once __DIR__ . "{$ds}fluidxml{$ds}ReservedCallStaticTrait.php"; |
|
46 | +require_once __DIR__ . "{$ds}fluidxml{$ds}ReservedCallTrait.php"; |
|
47 | 47 | |
48 | 48 | // All. |
49 | -require_once __DIR__ . "{$ds}FluidXml{$ds}CssTranslator.php"; |
|
50 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidContext.php"; |
|
51 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidDocument.php"; |
|
52 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidHelper.php"; |
|
53 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidInsertionHandler.php"; |
|
54 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidNamespace.php"; |
|
55 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidRepeater.php"; |
|
56 | -require_once __DIR__ . "{$ds}FluidXml{$ds}FluidXml.php"; |
|
49 | +require_once __DIR__ . "{$ds}fluidxml{$ds}CssTranslator.php"; |
|
50 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidContext.php"; |
|
51 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidDocument.php"; |
|
52 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidHelper.php"; |
|
53 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidInsertionHandler.php"; |
|
54 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidNamespace.php"; |
|
55 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidRepeater.php"; |
|
56 | +require_once __DIR__ . "{$ds}fluidxml{$ds}FluidXml.php"; |
|
57 | 57 | |
58 | 58 | // After of all. |
59 | -require_once __DIR__ . "{$ds}FluidXml{$ds}fluid.php"; |
|
59 | +require_once __DIR__ . "{$ds}fluidxml{$ds}fluid.php"; |
@@ -4,15 +4,15 @@ |
||
4 | 4 | |
5 | 5 | trait FluidAliasesTrait |
6 | 6 | { |
7 | - public function size() { return $this->length(); } |
|
8 | - public function __invoke(...$query) { return $this->query(...$query); } |
|
9 | - public function add($child, ...$optionals) { return $this->addChild($child, ...$optionals); } |
|
7 | + public function size() { return $this->length(); } |
|
8 | + public function __invoke(...$query) { return $this->query(...$query); } |
|
9 | + public function add($child, ...$optionals) { return $this->addChild($child, ...$optionals); } |
|
10 | 10 | public function prepend($sibling, ...$optionals) { return $this->prependSibling($sibling, ...$optionals); } |
11 | - public function append($sibling, ...$optionals) { return $this->appendSibling($sibling, ...$optionals); } |
|
12 | - public function attr($name, $value = null) { return $this->setAttribute($name, $value); } |
|
13 | - public function text($text) { return $this->setText($text); } |
|
14 | - public function cdata($text) { return $this->setCdata($text); } |
|
15 | - public function comment($text) { return $this->setComment($text); } |
|
11 | + public function append($sibling, ...$optionals) { return $this->appendSibling($sibling, ...$optionals); } |
|
12 | + public function attr($name, $value = null) { return $this->setAttribute($name, $value); } |
|
13 | + public function text($text) { return $this->setText($text); } |
|
14 | + public function cdata($text) { return $this->setCdata($text); } |
|
15 | + public function comment($text) { return $this->setComment($text); } |
|
16 | 16 | abstract public function length(); |
17 | 17 | abstract public function query(...$query); |
18 | 18 | abstract public function addChild($child, ...$optionals); |
@@ -4,15 +4,33 @@ |
||
4 | 4 | |
5 | 5 | trait FluidAliasesTrait |
6 | 6 | { |
7 | - public function size() { return $this->length(); } |
|
8 | - public function __invoke(...$query) { return $this->query(...$query); } |
|
9 | - public function add($child, ...$optionals) { return $this->addChild($child, ...$optionals); } |
|
10 | - public function prepend($sibling, ...$optionals) { return $this->prependSibling($sibling, ...$optionals); } |
|
11 | - public function append($sibling, ...$optionals) { return $this->appendSibling($sibling, ...$optionals); } |
|
12 | - public function attr($name, $value = null) { return $this->setAttribute($name, $value); } |
|
13 | - public function text($text) { return $this->setText($text); } |
|
14 | - public function cdata($text) { return $this->setCdata($text); } |
|
15 | - public function comment($text) { return $this->setComment($text); } |
|
7 | + public function size() |
|
8 | + { |
|
9 | +return $this->length(); } |
|
10 | + public function __invoke(...$query) |
|
11 | + { |
|
12 | +return $this->query(...$query); } |
|
13 | + public function add($child, ...$optionals) |
|
14 | + { |
|
15 | +return $this->addChild($child, ...$optionals); } |
|
16 | + public function prepend($sibling, ...$optionals) |
|
17 | + { |
|
18 | +return $this->prependSibling($sibling, ...$optionals); } |
|
19 | + public function append($sibling, ...$optionals) |
|
20 | + { |
|
21 | +return $this->appendSibling($sibling, ...$optionals); } |
|
22 | + public function attr($name, $value = null) |
|
23 | + { |
|
24 | +return $this->setAttribute($name, $value); } |
|
25 | + public function text($text) |
|
26 | + { |
|
27 | +return $this->setText($text); } |
|
28 | + public function cdata($text) |
|
29 | + { |
|
30 | +return $this->setCdata($text); } |
|
31 | + public function comment($text) |
|
32 | + { |
|
33 | +return $this->setComment($text); } |
|
16 | 34 | abstract public function length(); |
17 | 35 | abstract public function query(...$query); |
18 | 36 | abstract public function addChild($child, ...$optionals); |
@@ -8,10 +8,10 @@ |
||
8 | 8 | class FluidContext implements FluidInterface, \ArrayAccess, \Iterator |
9 | 9 | { |
10 | 10 | use FluidAliasesTrait, |
11 | - FluidSaveTrait, |
|
12 | - NewableTrait, |
|
13 | - ReservedCallTrait, // For compatibility with PHP 5.6. |
|
14 | - ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
11 | + FluidSaveTrait, |
|
12 | + NewableTrait, |
|
13 | + ReservedCallTrait, // For compatibility with PHP 5.6. |
|
14 | + ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
15 | 15 | |
16 | 16 | private $document; |
17 | 17 | private $handler; |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | use FluidAliasesTrait, |
11 | 11 | FluidSaveTrait, |
12 | 12 | NewableTrait, |
13 | - ReservedCallTrait, // For compatibility with PHP 5.6. |
|
14 | - ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
13 | + ReservedCallTrait, // For compatibility with PHP 5.6. |
|
14 | + ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
15 | 15 | |
16 | 16 | private $document; |
17 | 17 | private $handler; |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | $this->document = $document; |
24 | 24 | $this->handler = $handler; |
25 | 25 | |
26 | - if (! \is_array($context) && ! $context instanceof \Traversable) { |
|
26 | + if (!\is_array($context) && !$context instanceof \Traversable) { |
|
27 | 27 | // DOMDocument, DOMElement and DOMNode are not iterable. |
28 | 28 | // DOMNodeList and FluidContext are iterable. |
29 | - $context = [ $context ]; |
|
29 | + $context = [$context]; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | foreach ($context as $n) { |
33 | - if (! $n instanceof \DOMNode) { |
|
33 | + if (!$n instanceof \DOMNode) { |
|
34 | 34 | throw new \Exception('Node type not recognized.'); |
35 | 35 | } |
36 | 36 | |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | // addChild($child, $value?, $attributes? = [], $switchContext? = false) |
200 | 200 | public function addChild($child, ...$optionals) |
201 | 201 | { |
202 | - return $this->handler->insertElement($this->nodes, $child, $optionals, function ($parent, $element) { |
|
202 | + return $this->handler->insertElement($this->nodes, $child, $optionals, function($parent, $element) { |
|
203 | 203 | return $parent->appendChild($element); |
204 | 204 | }, $this); |
205 | 205 | } |
206 | 206 | |
207 | 207 | public function prependSibling($sibling, ...$optionals) |
208 | 208 | { |
209 | - return $this->handler->insertElement($this->nodes, $sibling, $optionals, function ($sibling, $element) { |
|
209 | + return $this->handler->insertElement($this->nodes, $sibling, $optionals, function($sibling, $element) { |
|
210 | 210 | if ($sibling->parentNode === null) { |
211 | 211 | // If the node doesn't have at least one parent node, |
212 | 212 | // the sibling creation fails. In this case we replace |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | public function appendSibling($sibling, ...$optionals) |
223 | 223 | { |
224 | - return $this->handler->insertElement($this->nodes, $sibling, $optionals, function ($sibling, $element) { |
|
224 | + return $this->handler->insertElement($this->nodes, $sibling, $optionals, function($sibling, $element) { |
|
225 | 225 | if ($sibling->parentNode === null) { |
226 | 226 | // If the node doesn't have at least one parent node, |
227 | 227 | // the sibling creation fails. In this case we replace |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | // setAttribute(['name' => 'value', ...]) |
240 | 240 | public function setAttribute($name, $value = null) |
241 | 241 | { |
242 | - $attrs = [ $name => $value ]; |
|
242 | + $attrs = [$name => $value]; |
|
243 | 243 | |
244 | 244 | if (\is_array($name)) { |
245 | 245 | $attrs = $name; |
@@ -394,10 +394,10 @@ discard block |
||
394 | 394 | |
395 | 395 | protected function resolveQuery($query) |
396 | 396 | { |
397 | - if ( $query === '.' |
|
397 | + if ($query === '.' |
|
398 | 398 | || $query[0] === '/' |
399 | - || ( $query[0] === '.' && $query[1] === '/' ) |
|
400 | - || ( $query[0] === '.' && $query[1] === '.' ) ) { |
|
399 | + || ($query[0] === '.' && $query[1] === '/') |
|
400 | + || ($query[0] === '.' && $query[1] === '.')) { |
|
401 | 401 | return $query; |
402 | 402 | } |
403 | 403 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $found = ($r === $u) || $found; |
416 | 416 | } |
417 | 417 | |
418 | - if (! $found) { |
|
418 | + if (!$found) { |
|
419 | 419 | $set[] = $r; |
420 | 420 | } |
421 | 421 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | $this->document = $document; |
14 | 14 | $this->dom = $document->dom; |
15 | - $this->namespaces =& $document->namespaces; |
|
15 | + $this->namespaces = & $document->namespaces; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function insertElement(&$nodes, $element, &$optionals, $fn, $orig_context) |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | // offers to the user and is the same of: |
35 | 35 | // 1. appending a child switching the context |
36 | 36 | // 2. setting the attributes over the new context. |
37 | - if (! empty($attributes)) { |
|
37 | + if (!empty($attributes)) { |
|
38 | 38 | $new_context->setAttribute($attributes); |
39 | 39 | } |
40 | 40 | |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | |
49 | 49 | protected function handleOptionals($element, &$optionals) |
50 | 50 | { |
51 | - if (! \is_array($element)) { |
|
52 | - $element = [ $element ]; |
|
51 | + if (!\is_array($element)) { |
|
52 | + $element = [$element]; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $switch_context = false; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - return [ $element, $attributes, $switch_context ]; |
|
71 | + return [$element, $attributes, $switch_context]; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | protected function recognizeStringMixed($k, $v) |
97 | 97 | { |
98 | - if (! \is_string($k)) { |
|
98 | + if (!\is_string($k)) { |
|
99 | 99 | return; |
100 | 100 | } |
101 | 101 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | if (\is_string($v)) { |
110 | - if (! FluidHelper::isAnXmlString($v)) { |
|
110 | + if (!FluidHelper::isAnXmlString($v)) { |
|
111 | 111 | return 'insertStringSimple'; |
112 | 112 | } |
113 | 113 | } else { |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | |
207 | 207 | protected function attachNodes($parent, $nodes, $fn) |
208 | 208 | { |
209 | - if (! \is_array($nodes) && ! $nodes instanceof \Traversable) { |
|
210 | - $nodes = [ $nodes ]; |
|
209 | + if (!\is_array($nodes) && !$nodes instanceof \Traversable) { |
|
210 | + $nodes = [$nodes]; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $context = []; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $el = $this->createElement($k, $v); |
257 | 257 | $el = $fn($parent, $el); |
258 | 258 | |
259 | - return [ $el ]; |
|
259 | + return [$el]; |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | protected function insertStringMixed($parent, $k, $v, $fn, &$optionals) |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | // they are supplied, so 'addChild' is the perfect operation. |
274 | 274 | $this->newContext($el)->addChild($v, ...$optionals); |
275 | 275 | |
276 | - return [ $el ]; |
|
276 | + return [$el]; |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | protected function insertIntegerArray($parent, $k, $v, $fn, &$optionals) |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $el = $this->createElement($v); |
301 | 301 | $el = $fn($parent, $el); |
302 | 302 | |
303 | - return [ $el ]; |
|
303 | + return [$el]; |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | protected function insertIntegerXml($parent, $k, $v, $fn) |
@@ -8,17 +8,17 @@ discard block |
||
8 | 8 | class FluidXml implements FluidInterface |
9 | 9 | { |
10 | 10 | use FluidAliasesTrait, |
11 | - FluidSaveTrait, |
|
12 | - NewableTrait, |
|
13 | - ReservedCallTrait, // For compatibility with PHP 5.6. |
|
14 | - ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
11 | + FluidSaveTrait, |
|
12 | + NewableTrait, |
|
13 | + ReservedCallTrait, // For compatibility with PHP 5.6. |
|
14 | + ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
15 | 15 | |
16 | 16 | const ROOT_NODE = 'doc'; |
17 | 17 | |
18 | 18 | private $defaults = [ 'root' => self::ROOT_NODE, |
19 | - 'version' => '1.0', |
|
20 | - 'encoding' => 'UTF-8', |
|
21 | - 'stylesheet' => null ]; |
|
19 | + 'version' => '1.0', |
|
20 | + 'encoding' => 'UTF-8', |
|
21 | + 'stylesheet' => null ]; |
|
22 | 22 | |
23 | 23 | private $document; |
24 | 24 | private $handler; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | // Now, we can further populate the DOM with any stylesheet or child. |
64 | 64 | $this->initStylesheet($options) |
65 | - ->initRoot($options); |
|
65 | + ->initRoot($options); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function mergeOptions(&$arguments) |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | { |
98 | 98 | if (! empty($options['stylesheet'])) { |
99 | 99 | $attrs = 'type="text/xsl" ' |
100 | - . "encoding=\"{$options['encoding']}\" " |
|
101 | - . 'indent="yes" ' |
|
102 | - . "href=\"{$options['stylesheet']}\""; |
|
100 | + . "encoding=\"{$options['encoding']}\" " |
|
101 | + . 'indent="yes" ' |
|
102 | + . "href=\"{$options['stylesheet']}\""; |
|
103 | 103 | |
104 | 104 | $stylesheet = new \DOMProcessingInstruction('xml-stylesheet', $attrs); |
105 | 105 |
@@ -10,15 +10,15 @@ discard block |
||
10 | 10 | use FluidAliasesTrait, |
11 | 11 | FluidSaveTrait, |
12 | 12 | NewableTrait, |
13 | - ReservedCallTrait, // For compatibility with PHP 5.6. |
|
14 | - ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
13 | + ReservedCallTrait, // For compatibility with PHP 5.6. |
|
14 | + ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
15 | 15 | |
16 | 16 | const ROOT_NODE = 'doc'; |
17 | 17 | |
18 | - private $defaults = [ 'root' => self::ROOT_NODE, |
|
18 | + private $defaults = ['root' => self::ROOT_NODE, |
|
19 | 19 | 'version' => '1.0', |
20 | 20 | 'encoding' => 'UTF-8', |
21 | - 'stylesheet' => null ]; |
|
21 | + 'stylesheet' => null]; |
|
22 | 22 | |
23 | 23 | private $document; |
24 | 24 | private $handler; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $document = \file_get_contents($file); |
32 | 32 | |
33 | 33 | // file_get_contents() returns false in case of error. |
34 | - if (! $document) { |
|
34 | + if (!$document) { |
|
35 | 35 | throw new \Exception("File '$file' not accessible."); |
36 | 36 | } |
37 | 37 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | private function initStylesheet(&$options) |
97 | 97 | { |
98 | - if (! empty($options['stylesheet'])) { |
|
98 | + if (!empty($options['stylesheet'])) { |
|
99 | 99 | $attrs = 'type="text/xsl" ' |
100 | 100 | . "encoding=\"{$options['encoding']}\" " |
101 | 101 | . 'indent="yes" ' |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | private function initRoot(&$options) |
117 | 117 | { |
118 | - if (! empty($options['root'])) { |
|
118 | + if (!empty($options['root'])) { |
|
119 | 119 | $this->appendSibling($options['root']); |
120 | 120 | } |
121 | 121 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $el = $this->document->dom; |
144 | 144 | } |
145 | 145 | |
146 | - return [ $el ]; |
|
146 | + return [$el]; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | public function __toString() |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $namespaces = []; |
187 | 187 | |
188 | 188 | if (\is_string($arguments[0])) { |
189 | - $args = [ $arguments[0], $arguments[1] ]; |
|
189 | + $args = [$arguments[0], $arguments[1]]; |
|
190 | 190 | |
191 | 191 | if (isset($arguments[2])) { |
192 | 192 | $args[] = $arguments[2]; |
@@ -207,18 +207,18 @@ discard block |
||
207 | 207 | return $this; |
208 | 208 | } |
209 | 209 | |
210 | - public function query(...$query) { return $this->context()->query(...$query); } |
|
210 | + public function query(...$query) { return $this->context()->query(...$query); } |
|
211 | 211 | public function times($times, callable $fn = null) { return $this->context()->times($times, $fn); } |
212 | - public function each(callable $fn) { return $this->context()->each($fn); } |
|
213 | - public function filter(callable $fn) { return $this->context()->filter($fn); } |
|
212 | + public function each(callable $fn) { return $this->context()->each($fn); } |
|
213 | + public function filter(callable $fn) { return $this->context()->filter($fn); } |
|
214 | 214 | public function setAttribute($name, $value = null) { $this->context()->setAttribute($name, $value); return $this; } |
215 | - public function setText($text) { $this->context()->setText($text); return $this; } |
|
216 | - public function addText($text) { $this->context()->addText($text); return $this; } |
|
217 | - public function setCdata($text) { $this->context()->setCdata($text); return $this; } |
|
218 | - public function addCdata($text) { $this->context()->addCdata($text); return $this; } |
|
219 | - public function setComment($text) { $this->context()->setComment($text); return $this; } |
|
220 | - public function addComment($text) { $this->context()->addComment($text); return $this; } |
|
221 | - public function remove(...$query) { $this->context()->remove(...$query); return $this; } |
|
215 | + public function setText($text) { $this->context()->setText($text); return $this; } |
|
216 | + public function addText($text) { $this->context()->addText($text); return $this; } |
|
217 | + public function setCdata($text) { $this->context()->setCdata($text); return $this; } |
|
218 | + public function addCdata($text) { $this->context()->addCdata($text); return $this; } |
|
219 | + public function setComment($text) { $this->context()->setComment($text); return $this; } |
|
220 | + public function addComment($text) { $this->context()->addComment($text); return $this; } |
|
221 | + public function remove(...$query) { $this->context()->remove(...$query); return $this; } |
|
222 | 222 | |
223 | 223 | public function addChild($child, ...$optionals) |
224 | 224 | { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | $namespaces[] = new FluidNamespace(...$args); |
196 | - } elseif (\is_array($arguments[0])) { |
|
196 | + } elseif (\is_array($arguments[0])) { |
|
197 | 197 | $namespaces = $arguments[0]; |
198 | 198 | } else { |
199 | 199 | $namespaces = $arguments; |
@@ -207,18 +207,42 @@ discard block |
||
207 | 207 | return $this; |
208 | 208 | } |
209 | 209 | |
210 | - public function query(...$query) { return $this->context()->query(...$query); } |
|
211 | - public function times($times, callable $fn = null) { return $this->context()->times($times, $fn); } |
|
212 | - public function each(callable $fn) { return $this->context()->each($fn); } |
|
213 | - public function filter(callable $fn) { return $this->context()->filter($fn); } |
|
214 | - public function setAttribute($name, $value = null) { $this->context()->setAttribute($name, $value); return $this; } |
|
215 | - public function setText($text) { $this->context()->setText($text); return $this; } |
|
216 | - public function addText($text) { $this->context()->addText($text); return $this; } |
|
217 | - public function setCdata($text) { $this->context()->setCdata($text); return $this; } |
|
218 | - public function addCdata($text) { $this->context()->addCdata($text); return $this; } |
|
219 | - public function setComment($text) { $this->context()->setComment($text); return $this; } |
|
220 | - public function addComment($text) { $this->context()->addComment($text); return $this; } |
|
221 | - public function remove(...$query) { $this->context()->remove(...$query); return $this; } |
|
210 | + public function query(...$query) |
|
211 | + { |
|
212 | +return $this->context()->query(...$query); } |
|
213 | + public function times($times, callable $fn = null) |
|
214 | + { |
|
215 | +return $this->context()->times($times, $fn); } |
|
216 | + public function each(callable $fn) |
|
217 | + { |
|
218 | +return $this->context()->each($fn); } |
|
219 | + public function filter(callable $fn) |
|
220 | + { |
|
221 | +return $this->context()->filter($fn); } |
|
222 | + public function setAttribute($name, $value = null) |
|
223 | + { |
|
224 | +$this->context()->setAttribute($name, $value); return $this; } |
|
225 | + public function setText($text) |
|
226 | + { |
|
227 | +$this->context()->setText($text); return $this; } |
|
228 | + public function addText($text) |
|
229 | + { |
|
230 | +$this->context()->addText($text); return $this; } |
|
231 | + public function setCdata($text) |
|
232 | + { |
|
233 | +$this->context()->setCdata($text); return $this; } |
|
234 | + public function addCdata($text) |
|
235 | + { |
|
236 | +$this->context()->addCdata($text); return $this; } |
|
237 | + public function setComment($text) |
|
238 | + { |
|
239 | +$this->context()->setComment($text); return $this; } |
|
240 | + public function addComment($text) |
|
241 | + { |
|
242 | +$this->context()->addComment($text); return $this; } |
|
243 | + public function remove(...$query) |
|
244 | + { |
|
245 | +$this->context()->remove(...$query); return $this; } |
|
222 | 246 | |
223 | 247 | public function addChild($child, ...$optionals) |
224 | 248 | { |