@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap; |
| 4 | 4 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $html = mb_convert_encoding($html, 'UTF-8', $charset); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $this->loadHTML('<?xml encoding="utf-8"?>' . $html); |
|
| 119 | + $this->loadHTML('<?xml encoding="utf-8"?>'.$html); |
|
| 120 | 120 | |
| 121 | 121 | libxml_use_internal_errors($internalErrors); |
| 122 | 122 | libxml_disable_entity_loader($disableEntities); |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap\Traits; |
| 4 | 4 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | 99 | } else { |
| 100 | - throw new \InvalidArgumentException('Unexpected input value of type "' . gettype($input) . '"'); |
|
| 100 | + throw new \InvalidArgumentException('Unexpected input value of type "'.gettype($input).'"'); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | // Build a list of matching nodes. |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $fn = $input; |
| 170 | 170 | |
| 171 | 171 | } else { |
| 172 | - throw new \InvalidArgumentException('Unexpected input value of type "' . gettype($input) . '"'); |
|
| 172 | + throw new \InvalidArgumentException('Unexpected input value of type "'.gettype($input).'"'); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | return $this->getNodesMatchingInput($fn); |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | */ |
| 348 | 348 | public function contents(): NodeList { |
| 349 | 349 | $results = $this->collection()->reduce(function($carry, $node) { |
| 350 | - if($node->isRemoved()) |
|
| 350 | + if ($node->isRemoved()) |
|
| 351 | 351 | return $this->newNodeList(); |
| 352 | 352 | return $carry->merge( |
| 353 | 353 | $node->newNodeList($node->childNodes) |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap\Traits; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap\Traits; |
| 4 | 4 | |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | * @return mixed |
| 26 | 26 | */ |
| 27 | 27 | public function __call(string $name, array $arguments) { |
| 28 | - if (!method_exists($this, '_' . $name)) { |
|
| 29 | - throw new \BadMethodCallException("Call to undefined method " . get_class($this) . '::' . $name . "()"); |
|
| 28 | + if (!method_exists($this, '_'.$name)) { |
|
| 29 | + throw new \BadMethodCallException("Call to undefined method ".get_class($this).'::'.$name."()"); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - return call_user_func_array([$this, '_' . $name], $arguments); |
|
| 32 | + return call_user_func_array([$this, '_'.$name], $arguments); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | * @return string |
| 187 | 187 | */ |
| 188 | 188 | public function getText(): string { |
| 189 | - return (string)$this->collection()->reduce(function($carry, $node) { |
|
| 190 | - return $carry . $node->textContent; |
|
| 189 | + return (string) $this->collection()->reduce(function($carry, $node) { |
|
| 190 | + return $carry.$node->textContent; |
|
| 191 | 191 | }, ''); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | * @return bool |
| 322 | 322 | */ |
| 323 | 323 | public function hasAttr(string $name): bool { |
| 324 | - return (bool)$this->collection()->reduce(function($carry, $node) use ($name) { |
|
| 324 | + return (bool) $this->collection()->reduce(function($carry, $node) use ($name) { |
|
| 325 | 325 | if ($node->hasAttribute($name)) { |
| 326 | 326 | return true; |
| 327 | 327 | } |
@@ -454,10 +454,10 @@ discard block |
||
| 454 | 454 | * @return bool |
| 455 | 455 | */ |
| 456 | 456 | public function hasClass(string $class): bool { |
| 457 | - return (bool)$this->collection()->reduce(function($carry, $node) use ($class) { |
|
| 457 | + return (bool) $this->collection()->reduce(function($carry, $node) use ($class) { |
|
| 458 | 458 | $attr = $node->getAttr('class'); |
| 459 | 459 | |
| 460 | - return array_reduce(explode(' ', (string)$attr), function($carry, $item) use ($class) { |
|
| 460 | + return array_reduce(explode(' ', (string) $attr), function($carry, $item) use ($class) { |
|
| 461 | 461 | if (strcasecmp($item, $class) == 0) { |
| 462 | 462 | return true; |
| 463 | 463 | } |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | */ |
| 638 | 638 | public function getHtml(): string { |
| 639 | 639 | return $this->collection()->first()->children()->reduce(function($carry, $node) { |
| 640 | - return $carry . $this->document()->saveHTML($node); |
|
| 640 | + return $carry.$this->document()->saveHTML($node); |
|
| 641 | 641 | }, ''); |
| 642 | 642 | } |
| 643 | 643 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap\Collections; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap; |
| 4 | 4 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $result = $this->__manipulationCall($name, $arguments); |
| 48 | 48 | } catch (\BadMethodCallException $e) { |
| 49 | 49 | if (!method_exists($this->first(), $name)) { |
| 50 | - throw new \BadMethodCallException("Call to undefined method " . get_class($this) . '::' . $name . "()"); |
|
| 50 | + throw new \BadMethodCallException("Call to undefined method ".get_class($this).'::'.$name."()"); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $result = call_user_func_array([$this->first(), $name], $arguments); |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DOMWrap; |
| 4 | 4 | |