@@ -184,7 +184,7 @@ |
||
184 | 184 | /** |
185 | 185 | * @param string|NodeList|\DOMNode|\Closure $input |
186 | 186 | * |
187 | - * @return string|self |
|
187 | + * @return string|null |
|
188 | 188 | */ |
189 | 189 | public function text($input = null) { |
190 | 190 | if (is_null($input)) { |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | * @return mixed |
42 | 42 | */ |
43 | 43 | public function __call($name, $arguments) { |
44 | - if (!method_exists($this, '_' . $name)) { |
|
45 | - throw new \BadMethodCallException("Call to undefined method " . get_class($this) . '::' . $name . "()"); |
|
44 | + if (!method_exists($this, '_'.$name)) { |
|
45 | + throw new \BadMethodCallException("Call to undefined method ".get_class($this).'::'.$name."()"); |
|
46 | 46 | } |
47 | 47 | |
48 | - return call_user_func_array([$this, '_' . $name], $arguments); |
|
48 | + return call_user_func_array([$this, '_'.$name], $arguments); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | */ |
200 | 200 | public function getText() { |
201 | 201 | return $this->collection()->reduce(function($carry, $node) { |
202 | - return $carry . $node->textContent; |
|
202 | + return $carry.$node->textContent; |
|
203 | 203 | }, ''); |
204 | 204 | } |
205 | 205 | |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | */ |
648 | 648 | public function getHtml() { |
649 | 649 | return $this->collection()->first()->children()->reduce(function($carry, $node) { |
650 | - return $carry . $this->document()->saveHTML($node); |
|
650 | + return $carry.$this->document()->saveHTML($node); |
|
651 | 651 | }, ''); |
652 | 652 | } |
653 | 653 |
@@ -353,8 +353,9 @@ |
||
353 | 353 | */ |
354 | 354 | public function contents() { |
355 | 355 | $results = $this->collection()->reduce(function($carry, $node) { |
356 | - if($node->isRemoved()) |
|
357 | - return $this->newNodeList(); |
|
356 | + if($node->isRemoved()) { |
|
357 | + return $this->newNodeList(); |
|
358 | + } |
|
358 | 359 | return $carry->merge( |
359 | 360 | $node->newNodeList($node->childNodes) |
360 | 361 | ); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | }; |
106 | 106 | |
107 | 107 | } else { |
108 | - throw new \InvalidArgumentException('Unexpected input value of type "' . gettype($input) . '"'); |
|
108 | + throw new \InvalidArgumentException('Unexpected input value of type "'.gettype($input).'"'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | // Build a list of matching nodes. |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $fn = $input; |
178 | 178 | |
179 | 179 | } else { |
180 | - throw new \InvalidArgumentException('Unexpected input value of type "' . gettype($input) . '"'); |
|
180 | + throw new \InvalidArgumentException('Unexpected input value of type "'.gettype($input).'"'); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | return $this->getNodesMatchingInput($fn); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | public function contents() { |
357 | 357 | $results = $this->collection()->reduce(function($carry, $node) { |
358 | - if($node->isRemoved()) |
|
358 | + if ($node->isRemoved()) |
|
359 | 359 | return $this->newNodeList(); |
360 | 360 | return $carry->merge( |
361 | 361 | $node->newNodeList($node->childNodes) |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $result = $this->__manipulationCall($name, $arguments); |
47 | 47 | } catch (\BadMethodCallException $e) { |
48 | 48 | if (!method_exists($this->first(), $name)) { |
49 | - throw new \BadMethodCallException("Call to undefined method " . get_class($this) . '::' . $name . "()"); |
|
49 | + throw new \BadMethodCallException("Call to undefined method ".get_class($this).'::'.$name."()"); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $result = call_user_func_array([$this->first(), $name], $arguments); |
@@ -105,7 +105,7 @@ |
||
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - $this->loadHTML('<?xml encoding="utf-8"?>' . $html); |
|
108 | + $this->loadHTML('<?xml encoding="utf-8"?>'.$html); |
|
109 | 109 | |
110 | 110 | libxml_use_internal_errors($internalErrors); |
111 | 111 | libxml_disable_entity_loader($disableEntities); |