@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | && |
106 | 106 | \count(\array_diff_key($this->properties, $data)) > 0 |
107 | 107 | ) { |
108 | - throw new \InvalidArgumentException('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($this->properties), true)); |
|
108 | + throw new \InvalidArgumentException('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($this->properties), true)); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | foreach ($data as $key => &$value) { |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | |
456 | 456 | $this->callAtPath( |
457 | 457 | $containerPath, |
458 | - static function ($container) use ($lastOffset, &$offsetExists) { |
|
458 | + static function($container) use ($lastOffset, &$offsetExists) { |
|
459 | 459 | $offsetExists = \array_key_exists($lastOffset, $container); |
460 | 460 | } |
461 | 461 | ); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | |
520 | 520 | $this->callAtPath( |
521 | 521 | \implode($this->pathSeparator, $path), |
522 | - static function (&$offset) use ($pathToUnset) { |
|
522 | + static function(&$offset) use ($pathToUnset) { |
|
523 | 523 | unset($offset[$pathToUnset]); |
524 | 524 | } |
525 | 525 | ); |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | } |
557 | 557 | |
558 | 558 | if (\strpos($class, '\\') === 0) { |
559 | - $class = '\\' . $class; |
|
559 | + $class = '\\'.$class; |
|
560 | 560 | if (\class_exists($class)) { |
561 | 561 | $this->iteratorClass = $class; |
562 | 562 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | } |
565 | 565 | } |
566 | 566 | |
567 | - throw new \InvalidArgumentException('The iterator class does not exist: ' . $class); |
|
567 | + throw new \InvalidArgumentException('The iterator class does not exist: '.$class); |
|
568 | 568 | } |
569 | 569 | |
570 | 570 | /** |
@@ -672,13 +672,13 @@ discard block |
||
672 | 672 | |
673 | 673 | foreach ($this->getGenerator() as $key => $item) { |
674 | 674 | if ($item instanceof self) { |
675 | - $result[$prefix . $key] = $item->appendToEachKey($prefix); |
|
675 | + $result[$prefix.$key] = $item->appendToEachKey($prefix); |
|
676 | 676 | } elseif (\is_array($item)) { |
677 | - $result[$prefix . $key] = self::create($item, $this->iteratorClass, false) |
|
677 | + $result[$prefix.$key] = self::create($item, $this->iteratorClass, false) |
|
678 | 678 | ->appendToEachKey($prefix) |
679 | 679 | ->toArray(); |
680 | 680 | } else { |
681 | - $result[$prefix . $key] = $item; |
|
681 | + $result[$prefix.$key] = $item; |
|
682 | 682 | } |
683 | 683 | } |
684 | 684 | |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | } elseif (\is_object($item)) { |
707 | 707 | $result[$key] = $item; |
708 | 708 | } else { |
709 | - $result[$key] = $prefix . $item; |
|
709 | + $result[$key] = $prefix.$item; |
|
710 | 710 | } |
711 | 711 | } |
712 | 712 | |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | public function clean(): self |
858 | 858 | { |
859 | 859 | return $this->filter( |
860 | - static function ($value) { |
|
860 | + static function($value) { |
|
861 | 861 | return (bool) $value; |
862 | 862 | } |
863 | 863 | ); |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | return $this->in_array_recursive( |
911 | 911 | \mb_strtoupper((string) $value), |
912 | 912 | $this->walk( |
913 | - static function (&$val) { |
|
913 | + static function(&$val) { |
|
914 | 914 | /** @noinspection PhpComposerExtensionStubsInspection */ |
915 | 915 | $val = \mb_strtoupper((string) $val); |
916 | 916 | }, |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | return \in_array( |
925 | 925 | \mb_strtoupper((string) $value), |
926 | 926 | $this->walk( |
927 | - static function (&$val) { |
|
927 | + static function(&$val) { |
|
928 | 928 | /** @noinspection PhpComposerExtensionStubsInspection */ |
929 | 929 | $val = \mb_strtoupper((string) $val); |
930 | 930 | }, |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | // trim all string in the array |
1198 | 1198 | \array_walk( |
1199 | 1199 | $array, |
1200 | - static function (&$val) { |
|
1200 | + static function(&$val) { |
|
1201 | 1201 | if (\is_string($val)) { |
1202 | 1202 | $val = \trim($val); |
1203 | 1203 | } |
@@ -1525,40 +1525,40 @@ discard block |
||
1525 | 1525 | } |
1526 | 1526 | |
1527 | 1527 | $ops = [ |
1528 | - 'eq' => static function ($item, $prop, $value) { |
|
1528 | + 'eq' => static function($item, $prop, $value) { |
|
1529 | 1529 | return $item[$prop] === $value; |
1530 | 1530 | }, |
1531 | - 'gt' => static function ($item, $prop, $value) { |
|
1531 | + 'gt' => static function($item, $prop, $value) { |
|
1532 | 1532 | return $item[$prop] > $value; |
1533 | 1533 | }, |
1534 | - 'ge' => static function ($item, $prop, $value) { |
|
1534 | + 'ge' => static function($item, $prop, $value) { |
|
1535 | 1535 | return $item[$prop] >= $value; |
1536 | 1536 | }, |
1537 | - 'gte' => static function ($item, $prop, $value) { |
|
1537 | + 'gte' => static function($item, $prop, $value) { |
|
1538 | 1538 | return $item[$prop] >= $value; |
1539 | 1539 | }, |
1540 | - 'lt' => static function ($item, $prop, $value) { |
|
1540 | + 'lt' => static function($item, $prop, $value) { |
|
1541 | 1541 | return $item[$prop] < $value; |
1542 | 1542 | }, |
1543 | - 'le' => static function ($item, $prop, $value) { |
|
1543 | + 'le' => static function($item, $prop, $value) { |
|
1544 | 1544 | return $item[$prop] <= $value; |
1545 | 1545 | }, |
1546 | - 'lte' => static function ($item, $prop, $value) { |
|
1546 | + 'lte' => static function($item, $prop, $value) { |
|
1547 | 1547 | return $item[$prop] <= $value; |
1548 | 1548 | }, |
1549 | - 'ne' => static function ($item, $prop, $value) { |
|
1549 | + 'ne' => static function($item, $prop, $value) { |
|
1550 | 1550 | return $item[$prop] !== $value; |
1551 | 1551 | }, |
1552 | - 'contains' => static function ($item, $prop, $value) { |
|
1552 | + 'contains' => static function($item, $prop, $value) { |
|
1553 | 1553 | return \in_array($item[$prop], (array) $value, true); |
1554 | 1554 | }, |
1555 | - 'notContains' => static function ($item, $prop, $value) { |
|
1555 | + 'notContains' => static function($item, $prop, $value) { |
|
1556 | 1556 | return !\in_array($item[$prop], (array) $value, true); |
1557 | 1557 | }, |
1558 | - 'newer' => static function ($item, $prop, $value) { |
|
1558 | + 'newer' => static function($item, $prop, $value) { |
|
1559 | 1559 | return \strtotime($item[$prop]) > \strtotime($value); |
1560 | 1560 | }, |
1561 | - 'older' => static function ($item, $prop, $value) { |
|
1561 | + 'older' => static function($item, $prop, $value) { |
|
1562 | 1562 | return \strtotime($item[$prop]) < \strtotime($value); |
1563 | 1563 | }, |
1564 | 1564 | ]; |
@@ -1566,7 +1566,7 @@ discard block |
||
1566 | 1566 | $result = \array_values( |
1567 | 1567 | \array_filter( |
1568 | 1568 | $this->getArray(), |
1569 | - static function ($item) use ( |
|
1569 | + static function($item) use ( |
|
1570 | 1570 | $property, |
1571 | 1571 | $value, |
1572 | 1572 | $ops, |
@@ -2073,7 +2073,7 @@ discard block |
||
2073 | 2073 | \array_uintersect( |
2074 | 2074 | $this->array, |
2075 | 2075 | $search, |
2076 | - static function ($a, $b) { |
|
2076 | + static function($a, $b) { |
|
2077 | 2077 | return $a === $b ? 0 : -1; |
2078 | 2078 | } |
2079 | 2079 | ), |
@@ -2776,7 +2776,7 @@ discard block |
||
2776 | 2776 | )->prependToEachKey($suffix) |
2777 | 2777 | ->toArray(); |
2778 | 2778 | } else { |
2779 | - $result[$key . $suffix] = $item; |
|
2779 | + $result[$key.$suffix] = $item; |
|
2780 | 2780 | } |
2781 | 2781 | } |
2782 | 2782 | |
@@ -2813,7 +2813,7 @@ discard block |
||
2813 | 2813 | } elseif (\is_object($item)) { |
2814 | 2814 | $result[$key] = $item; |
2815 | 2815 | } else { |
2816 | - $result[$key] = $item . $suffix; |
|
2816 | + $result[$key] = $item.$suffix; |
|
2817 | 2817 | } |
2818 | 2818 | } |
2819 | 2819 | |
@@ -3344,7 +3344,7 @@ discard block |
||
3344 | 3344 | public function replaceValues($search, $replacement = ''): self |
3345 | 3345 | { |
3346 | 3346 | $array = $this->each( |
3347 | - static function ($value) use ($search, $replacement) { |
|
3347 | + static function($value) use ($search, $replacement) { |
|
3348 | 3348 | return \str_replace($search, $replacement, $value); |
3349 | 3349 | } |
3350 | 3350 | ); |
@@ -3748,7 +3748,7 @@ discard block |
||
3748 | 3748 | |
3749 | 3749 | $that = $this; |
3750 | 3750 | $results = $arrayy->each( |
3751 | - static function ($value) use ($sorter, $that) { |
|
3751 | + static function($value) use ($sorter, $that) { |
|
3752 | 3752 | return \is_callable($sorter) ? $sorter($value) : $that->get($sorter, null, $value); |
3753 | 3753 | } |
3754 | 3754 | ); |
@@ -3806,7 +3806,7 @@ discard block |
||
3806 | 3806 | public function stripEmpty(): self |
3807 | 3807 | { |
3808 | 3808 | return $this->filter( |
3809 | - static function ($item) { |
|
3809 | + static function($item) { |
|
3810 | 3810 | if ($item === null) { |
3811 | 3811 | return false; |
3812 | 3812 | } |
@@ -3886,7 +3886,7 @@ discard block |
||
3886 | 3886 | // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array |
3887 | 3887 | |
3888 | 3888 | $this->array = $this->reduce( |
3889 | - static function ($resultArray, $value) { |
|
3889 | + static function($resultArray, $value) { |
|
3890 | 3890 | if (!\in_array($value, $resultArray, true)) { |
3891 | 3891 | $resultArray[] = $value; |
3892 | 3892 | } |
@@ -3915,7 +3915,7 @@ discard block |
||
3915 | 3915 | |
3916 | 3916 | $this->array = \array_reduce( |
3917 | 3917 | \array_keys($array), |
3918 | - static function ($resultArray, $key) use ($array) { |
|
3918 | + static function($resultArray, $key) use ($array) { |
|
3919 | 3919 | if (!\in_array($array[$key], $resultArray, true)) { |
3920 | 3920 | $resultArray[$key] = $array[$key]; |
3921 | 3921 | } |
@@ -4357,7 +4357,7 @@ discard block |
||
4357 | 4357 | $this->properties !== [] |
4358 | 4358 | ) { |
4359 | 4359 | if (isset($this->properties[$key]) === false) { |
4360 | - throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').'); |
|
4360 | + throw new \InvalidArgumentException('The key '.$key.' does not exists as @property in the class ('.\get_class($this).').'); |
|
4361 | 4361 | } |
4362 | 4362 | |
4363 | 4363 | $this->properties[$key]->checkType($value); |
@@ -4497,7 +4497,7 @@ discard block |
||
4497 | 4497 | private function getPropertiesFromPhpDoc(): array |
4498 | 4498 | { |
4499 | 4499 | static $PROPERTY_CACHE = []; |
4500 | - $cacheKey = 'Class::' . static::class; |
|
4500 | + $cacheKey = 'Class::'.static::class; |
|
4501 | 4501 | |
4502 | 4502 | if (isset($PROPERTY_CACHE[$cacheKey])) { |
4503 | 4503 | return $PROPERTY_CACHE[$cacheKey]; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | if ($this->checkType($this->collectionType, $value) === false) { |
91 | 91 | throw new \InvalidArgumentException( |
92 | - 'Value must be of type ' . $this->collectionType . '; value is ' . $this->valueToString($value) |
|
92 | + 'Value must be of type '.$this->collectionType.'; value is '.$this->valueToString($value) |
|
93 | 93 | ); |
94 | 94 | } |
95 | 95 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | if ($this->checkType($this->collectionType, $value) === false) { |
111 | 111 | throw new \InvalidArgumentException( |
112 | - 'Value must be of type ' . $this->collectionType . '; value is ' . $this->valueToString($value) |
|
112 | + 'Value must be of type '.$this->collectionType.'; value is '.$this->valueToString($value) |
|
113 | 113 | ); |
114 | 114 | } |
115 | 115 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | { |
130 | 130 | if ($this->checkType($this->collectionType, $value) === false) { |
131 | 131 | throw new \InvalidArgumentException( |
132 | - 'Value must be of type ' . $this->collectionType . '; value is ' . $this->valueToString($value) |
|
132 | + 'Value must be of type '.$this->collectionType.'; value is '.$this->valueToString($value) |
|
133 | 133 | ); |
134 | 134 | } |
135 | 135 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | public function where(string $keyOrPropertyOrMethod, $value): CollectionInterface |
171 | 171 | { |
172 | 172 | return $this->filter( |
173 | - function ($item) use ($keyOrPropertyOrMethod, $value) { |
|
173 | + function($item) use ($keyOrPropertyOrMethod, $value) { |
|
174 | 174 | $accessorValue = $this->extractValue( |
175 | 175 | $item, |
176 | 176 | $keyOrPropertyOrMethod |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | { |
195 | 195 | if ($this->checkType($this->collectionType, $value) === false) { |
196 | 196 | throw new \InvalidArgumentException( |
197 | - 'Value must be of type ' . $this->collectionType . '; value is ' . $this->valueToString($value) |
|
197 | + 'Value must be of type '.$this->collectionType.'; value is '.$this->valueToString($value) |
|
198 | 198 | ); |
199 | 199 | } |
200 | 200 | |
@@ -303,10 +303,10 @@ discard block |
||
303 | 303 | |
304 | 304 | // resource |
305 | 305 | if (\is_resource($value)) { |
306 | - return \get_resource_type($value) . ' resource #' . (int) $value; |
|
306 | + return \get_resource_type($value).' resource #'.(int) $value; |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | // object |
310 | - return \get_class($value) . ' Object'; |
|
310 | + return \get_class($value).' Object'; |
|
311 | 311 | } |
312 | 312 | } |