@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public static function strictArrayIntersect(array $arr1, array $arr2): array |
| 62 | 62 | { |
| 63 | - $arr = array_filter($arr1, function ($val1) use ($arr2) { |
|
| 63 | + $arr = array_filter($arr1, function($val1) use ($arr2) { |
|
| 64 | 64 | return in_array($val1, $arr2, true); |
| 65 | 65 | }); |
| 66 | 66 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public static function strictArrayDiff(array $arr1, array $arr2): array |
| 79 | 79 | { |
| 80 | - $arr = array_filter($arr1, function ($val1) use ($arr2) { |
|
| 80 | + $arr = array_filter($arr1, function($val1) use ($arr2) { |
|
| 81 | 81 | return !in_array($val1, $arr2, true); |
| 82 | 82 | }); |
| 83 | 83 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | array $haystack |
| 98 | 98 | ): array { |
| 99 | 99 | $needle = strtolower($needle); |
| 100 | - $match = array_filter($haystack, function ($value) use ($needle) { |
|
| 100 | + $match = array_filter($haystack, function($value) use ($needle) { |
|
| 101 | 101 | return $needle === strtolower($value); |
| 102 | 102 | }); |
| 103 | 103 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function outerHtml() |
| 47 | 47 | { |
| 48 | - return $this->mapFirst(function (HtmlNode $node) { |
|
| 48 | + return $this->mapFirst(function(HtmlNode $node) { |
|
| 49 | 49 | return $node->outerHtml(); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function getHtml() |
| 76 | 76 | { |
| 77 | - return $this->mapFirst(function (HtmlNode $node) { |
|
| 77 | + return $this->mapFirst(function(HtmlNode $node) { |
|
| 78 | 78 | return $node->getHtml(); |
| 79 | 79 | }); |
| 80 | 80 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function getText() |
| 124 | 124 | { |
| 125 | - return $this->mapFirst(function (HtmlNode $node) { |
|
| 125 | + return $this->mapFirst(function(HtmlNode $node) { |
|
| 126 | 126 | return $node->getText(); |
| 127 | 127 | }); |
| 128 | 128 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function setText(string $text) |
| 138 | 138 | { |
| 139 | - return $this->each(function (HtmlNode $node) use ($text) { |
|
| 139 | + return $this->each(function(HtmlNode $node) use ($text) { |
|
| 140 | 140 | $node->setText($text); |
| 141 | 141 | }); |
| 142 | 142 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function empty() |
| 150 | 150 | { |
| 151 | - return $this->each(function (HtmlNode $node) { |
|
| 151 | + return $this->each(function(HtmlNode $node) { |
|
| 152 | 152 | $node->empty(); |
| 153 | 153 | }); |
| 154 | 154 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | if (!is_null($selector)) { |
| 167 | 167 | $this->filter($selector)->remove(); |
| 168 | 168 | } else { |
| 169 | - $this->each(function (HtmlNode $node) { |
|
| 169 | + $this->each(function(HtmlNode $node) { |
|
| 170 | 170 | $node->remove(); |
| 171 | 171 | }); |
| 172 | 172 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | public function getVal() |
| 200 | 200 | { |
| 201 | - return $this->mapFirst(function (HtmlElement $node) { |
|
| 201 | + return $this->mapFirst(function(HtmlElement $node) { |
|
| 202 | 202 | return $node->getVal(); |
| 203 | 203 | }); |
| 204 | 204 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function setVal(string $value) |
| 214 | 214 | { |
| 215 | - return $this->each(function (HtmlElement $node) use ($value) { |
|
| 215 | + return $this->each(function(HtmlElement $node) use ($value) { |
|
| 216 | 216 | $node->setVal($value); |
| 217 | 217 | }); |
| 218 | 218 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | public function addClass(string $className) |
| 228 | 228 | { |
| 229 | - return $this->each(function (HtmlElement $node) use ($className) { |
|
| 229 | + return $this->each(function(HtmlElement $node) use ($className) { |
|
| 230 | 230 | $node->addClass($className); |
| 231 | 231 | }); |
| 232 | 232 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | public function hasClass(string $className) |
| 242 | 242 | { |
| 243 | 243 | return $this->mapAnyTrue( |
| 244 | - function (HtmlElement $node) use ($className) { |
|
| 244 | + function(HtmlElement $node) use ($className) { |
|
| 245 | 245 | return $node->hasClass($className); |
| 246 | 246 | } |
| 247 | 247 | ); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | public function removeClass(?string $className = null) |
| 259 | 259 | { |
| 260 | - return $this->each(function (HtmlElement $node) use ($className) { |
|
| 260 | + return $this->each(function(HtmlElement $node) use ($className) { |
|
| 261 | 261 | $node->removeClass($className); |
| 262 | 262 | }); |
| 263 | 263 | } |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | */ |
| 274 | 274 | public function toggleClass(string $className, ?bool $state = null) |
| 275 | 275 | { |
| 276 | - return $this->each(function (HtmlElement $node) use ($className, $state) { |
|
| 276 | + return $this->each(function(HtmlElement $node) use ($className, $state) { |
|
| 277 | 277 | $node->toggleClass($className, $state); |
| 278 | 278 | }); |
| 279 | 279 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | public function getCss(string $name) |
| 315 | 315 | { |
| 316 | - return $this->mapFirst(function (HtmlElement $node) use ($name) { |
|
| 316 | + return $this->mapFirst(function(HtmlElement $node) use ($name) { |
|
| 317 | 317 | return $node->getCss($name); |
| 318 | 318 | }); |
| 319 | 319 | } |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | public function setCss(string $name, ?string $value) |
| 330 | 330 | { |
| 331 | - return $this->each(function (HtmlElement $node) use ($name, $value) { |
|
| 331 | + return $this->each(function(HtmlElement $node) use ($name, $value) { |
|
| 332 | 332 | $node->setCss($name, $value); |
| 333 | 333 | }); |
| 334 | 334 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | public function removeCss(string $name) |
| 344 | 344 | { |
| 345 | - return $this->each(function (HtmlElement $node) use ($name) { |
|
| 345 | + return $this->each(function(HtmlElement $node) use ($name) { |
|
| 346 | 346 | $node->removeCss($name); |
| 347 | 347 | }); |
| 348 | 348 | } |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | { |
| 359 | 359 | $nodes = $this->convertNodes($nodes); |
| 360 | 360 | |
| 361 | - array_map(function ($node) { |
|
| 361 | + array_map(function($node) { |
|
| 362 | 362 | if (!($node instanceof DOMNode)) { |
| 363 | 363 | throw new Exception( |
| 364 | 364 | 'Expect an instance of DOMNode, ' |