@@ -11,15 +11,15 @@ discard block |
||
| 11 | 11 | use FluidAliasesTrait, |
| 12 | 12 | FluidSaveTrait, |
| 13 | 13 | NewableTrait, |
| 14 | - ReservedCallTrait, // For compatibility with PHP 5.6. |
|
| 15 | - ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
| 14 | + ReservedCallTrait, // For compatibility with PHP 5.6. |
|
| 15 | + ReservedCallStaticTrait; // For compatibility with PHP 5.6. |
|
| 16 | 16 | |
| 17 | 17 | const ROOT_NODE = 'doc'; |
| 18 | 18 | |
| 19 | - private $defaults = [ 'root' => self::ROOT_NODE, |
|
| 19 | + private $defaults = ['root' => self::ROOT_NODE, |
|
| 20 | 20 | 'version' => '1.0', |
| 21 | 21 | 'encoding' => 'UTF-8', |
| 22 | - 'stylesheet' => null ]; |
|
| 22 | + 'stylesheet' => null]; |
|
| 23 | 23 | |
| 24 | 24 | private $document; |
| 25 | 25 | private $handler; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $document = \file_get_contents($file); |
| 33 | 33 | |
| 34 | 34 | // file_get_contents() returns false in case of error. |
| 35 | - if (! $document) { |
|
| 35 | + if (!$document) { |
|
| 36 | 36 | throw new \Exception("File '$file' not accessible."); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | private function initStylesheet(&$options) |
| 98 | 98 | { |
| 99 | - if (! empty($options['stylesheet'])) { |
|
| 99 | + if (!empty($options['stylesheet'])) { |
|
| 100 | 100 | $attrs = 'type="text/xsl" ' |
| 101 | 101 | . "encoding=\"{$options['encoding']}\" " |
| 102 | 102 | . 'indent="yes" ' |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | private function initRoot(&$options) |
| 118 | 118 | { |
| 119 | - if (! empty($options['root'])) { |
|
| 119 | + if (!empty($options['root'])) { |
|
| 120 | 120 | $this->appendSibling($options['root']); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $el = $this->document->dom; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - return [ $el ]; |
|
| 147 | + return [$el]; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | public function __toString() |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $namespaces = []; |
| 188 | 188 | |
| 189 | 189 | if (\is_string($arguments[0])) { |
| 190 | - $args = [ $arguments[0], $arguments[1] ]; |
|
| 190 | + $args = [$arguments[0], $arguments[1]]; |
|
| 191 | 191 | |
| 192 | 192 | if (isset($arguments[2])) { |
| 193 | 193 | $args[] = $arguments[2]; |
@@ -206,19 +206,19 @@ discard block |
||
| 206 | 206 | return $this; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - public function query(...$query) { return $this->context()->query(...$query); } |
|
| 209 | + public function query(...$query) { return $this->context()->query(...$query); } |
|
| 210 | 210 | public function times($times, callable $fn = null) { return $this->context()->times($times, $fn); } |
| 211 | - public function each(callable $fn) { return $this->context()->each($fn); } |
|
| 212 | - public function map(callable $fn) { return $this->context()->map($fn); } |
|
| 213 | - public function filter(callable $fn) { return $this->context()->filter($fn); } |
|
| 211 | + public function each(callable $fn) { return $this->context()->each($fn); } |
|
| 212 | + public function map(callable $fn) { return $this->context()->map($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 | { |
@@ -206,19 +206,45 @@ |
||
| 206 | 206 | return $this; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - public function query(...$query) { return $this->context()->query(...$query); } |
|
| 210 | - public function times($times, callable $fn = null) { return $this->context()->times($times, $fn); } |
|
| 211 | - public function each(callable $fn) { return $this->context()->each($fn); } |
|
| 212 | - public function map(callable $fn) { return $this->context()->map($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; } |
|
| 209 | + public function query(...$query) |
|
| 210 | + { |
|
| 211 | +return $this->context()->query(...$query); } |
|
| 212 | + public function times($times, callable $fn = null) |
|
| 213 | + { |
|
| 214 | +return $this->context()->times($times, $fn); } |
|
| 215 | + public function each(callable $fn) |
|
| 216 | + { |
|
| 217 | +return $this->context()->each($fn); } |
|
| 218 | + public function map(callable $fn) |
|
| 219 | + { |
|
| 220 | +return $this->context()->map($fn); } |
|
| 221 | + public function filter(callable $fn) |
|
| 222 | + { |
|
| 223 | +return $this->context()->filter($fn); } |
|
| 224 | + public function setAttribute($name, $value = null) |
|
| 225 | + { |
|
| 226 | +$this->context()->setAttribute($name, $value); return $this; } |
|
| 227 | + public function setText($text) |
|
| 228 | + { |
|
| 229 | +$this->context()->setText($text); return $this; } |
|
| 230 | + public function addText($text) |
|
| 231 | + { |
|
| 232 | +$this->context()->addText($text); return $this; } |
|
| 233 | + public function setCdata($text) |
|
| 234 | + { |
|
| 235 | +$this->context()->setCdata($text); return $this; } |
|
| 236 | + public function addCdata($text) |
|
| 237 | + { |
|
| 238 | +$this->context()->addCdata($text); return $this; } |
|
| 239 | + public function setComment($text) |
|
| 240 | + { |
|
| 241 | +$this->context()->setComment($text); return $this; } |
|
| 242 | + public function addComment($text) |
|
| 243 | + { |
|
| 244 | +$this->context()->addComment($text); return $this; } |
|
| 245 | + public function remove(...$query) |
|
| 246 | + { |
|
| 247 | +$this->context()->remove(...$query); return $this; } |
|
| 222 | 248 | |
| 223 | 249 | public function addChild($child, ...$optionals) |
| 224 | 250 | { |