@@ -1932,7 +1932,7 @@ discard block |
||
| 1932 | 1932 | * |
| 1933 | 1933 | * @param float|int|string $low <p>First value of the sequence.</p> |
| 1934 | 1934 | * @param float|int|string $high <p>The sequence is ended upon reaching the end value.</p> |
| 1935 | - * @param float|int $step <p>Used as the increment between elements in the sequence.</p> |
|
| 1935 | + * @param integer $step <p>Used as the increment between elements in the sequence.</p> |
|
| 1936 | 1936 | * |
| 1937 | 1937 | * @return static |
| 1938 | 1938 | * <p>(Immutable) Returns an new instance of the Arrayy object.</p> |
@@ -2733,7 +2733,7 @@ discard block |
||
| 2733 | 2733 | /** |
| 2734 | 2734 | * Get the first key from the current array. |
| 2735 | 2735 | * |
| 2736 | - * @return mixed|null |
|
| 2736 | + * @return integer|null |
|
| 2737 | 2737 | * <p>Return null if there wasn't a element.</p> |
| 2738 | 2738 | * |
| 2739 | 2739 | * @phpstan-return TKey|null |
@@ -4145,7 +4145,7 @@ discard block |
||
| 4145 | 4145 | /** |
| 4146 | 4146 | * Get the last key from the current array. |
| 4147 | 4147 | * |
| 4148 | - * @return mixed|null |
|
| 4148 | + * @return null|integer |
|
| 4149 | 4149 | * <p>Return null if there wasn't a element.</p> |
| 4150 | 4150 | * @psalm-mutation-free |
| 4151 | 4151 | */ |
@@ -4605,7 +4605,7 @@ discard block |
||
| 4605 | 4605 | /** |
| 4606 | 4606 | * Get the most used value from the array. |
| 4607 | 4607 | * |
| 4608 | - * @return mixed|null |
|
| 4608 | + * @return integer|null |
|
| 4609 | 4609 | * <p>(Immutable) Return null if there wasn't an element.</p> |
| 4610 | 4610 | * |
| 4611 | 4611 | * @phpstan-return T|null |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | /** |
| 329 | 329 | * @phpstan-return \Generator<TKey,T> $generator |
| 330 | 330 | */ |
| 331 | - $generator = function () use ($key, $value): \Generator { |
|
| 331 | + $generator = function() use ($key, $value): \Generator { |
|
| 332 | 332 | if ($this->properties !== []) { |
| 333 | 333 | $this->checkType($key, $value); |
| 334 | 334 | } |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | |
| 517 | 517 | /** @phpstan-var \Arrayy\ArrayyRewindableGenerator<TKey,T> */ |
| 518 | 518 | $generatorTmp = new ArrayyRewindableExtendedGenerator( |
| 519 | - static function () use ($generator): \Generator { |
|
| 519 | + static function() use ($generator): \Generator { |
|
| 520 | 520 | yield from $generator; |
| 521 | 521 | }, |
| 522 | 522 | null, |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | */ |
| 725 | 725 | $this->callAtPath( |
| 726 | 726 | $containerPath, |
| 727 | - static function ($container) use ($lastOffset, &$offsetExists) { |
|
| 727 | + static function($container) use ($lastOffset, &$offsetExists) { |
|
| 728 | 728 | $offsetExists = \array_key_exists($lastOffset, $container); |
| 729 | 729 | } |
| 730 | 730 | ); |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | */ |
| 830 | 830 | $this->callAtPath( |
| 831 | 831 | \implode($this->pathSeparator, $path), |
| 832 | - static function (&$offset) use ($pathToUnset) { |
|
| 832 | + static function(&$offset) use ($pathToUnset) { |
|
| 833 | 833 | if (\is_array($offset)) { |
| 834 | 834 | unset($offset[$pathToUnset]); |
| 835 | 835 | } else { |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | |
| 885 | 885 | if (\strpos($iteratorClass, '\\') === 0) { |
| 886 | 886 | /** @var class-string<\Arrayy\ArrayyIterator<TKey,T>> $iteratorClass */ |
| 887 | - $iteratorClass = '\\' . $iteratorClass; |
|
| 887 | + $iteratorClass = '\\'.$iteratorClass; |
|
| 888 | 888 | if (\class_exists($iteratorClass)) { |
| 889 | 889 | /** |
| 890 | 890 | * @psalm-suppress PropertyTypeCoercion |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | } |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | - throw new \InvalidArgumentException('The iterator class does not exist: ' . $iteratorClass); |
|
| 898 | + throw new \InvalidArgumentException('The iterator class does not exist: '.$iteratorClass); |
|
| 899 | 899 | } |
| 900 | 900 | |
| 901 | 901 | /** |
@@ -1074,13 +1074,13 @@ discard block |
||
| 1074 | 1074 | |
| 1075 | 1075 | foreach ($this->getGenerator() as $key => $item) { |
| 1076 | 1076 | if ($item instanceof self) { |
| 1077 | - $result[$prefix . $key] = $item->appendToEachKey($prefix); |
|
| 1077 | + $result[$prefix.$key] = $item->appendToEachKey($prefix); |
|
| 1078 | 1078 | } elseif (\is_array($item)) { |
| 1079 | - $result[$prefix . $key] = self::create($item, $this->iteratorClass, false) |
|
| 1079 | + $result[$prefix.$key] = self::create($item, $this->iteratorClass, false) |
|
| 1080 | 1080 | ->appendToEachKey($prefix) |
| 1081 | 1081 | ->toArray(); |
| 1082 | 1082 | } else { |
| 1083 | - $result[$prefix . $key] = $item; |
|
| 1083 | + $result[$prefix.$key] = $item; |
|
| 1084 | 1084 | } |
| 1085 | 1085 | } |
| 1086 | 1086 | |
@@ -1115,7 +1115,7 @@ discard block |
||
| 1115 | 1115 | } elseif (\is_object($item) === true) { |
| 1116 | 1116 | $result[$key] = $item; |
| 1117 | 1117 | } else { |
| 1118 | - $result[$key] = $prefix . $item; |
|
| 1118 | + $result[$key] = $prefix.$item; |
|
| 1119 | 1119 | } |
| 1120 | 1120 | } |
| 1121 | 1121 | |
@@ -1302,7 +1302,7 @@ discard block |
||
| 1302 | 1302 | public function chunk($size, $preserveKeys = false): self |
| 1303 | 1303 | { |
| 1304 | 1304 | if ($preserveKeys) { |
| 1305 | - $generator = function () use ($size) { |
|
| 1305 | + $generator = function() use ($size) { |
|
| 1306 | 1306 | $values = []; |
| 1307 | 1307 | $tmpCounter = 0; |
| 1308 | 1308 | foreach ($this->getGenerator() as $key => $value) { |
@@ -1322,7 +1322,7 @@ discard block |
||
| 1322 | 1322 | } |
| 1323 | 1323 | }; |
| 1324 | 1324 | } else { |
| 1325 | - $generator = function () use ($size) { |
|
| 1325 | + $generator = function() use ($size) { |
|
| 1326 | 1326 | $values = []; |
| 1327 | 1327 | $tmpCounter = 0; |
| 1328 | 1328 | foreach ($this->getGenerator() as $value) { |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | public function clean(): self |
| 1367 | 1367 | { |
| 1368 | 1368 | return $this->filter( |
| 1369 | - static function ($value) { |
|
| 1369 | + static function($value) { |
|
| 1370 | 1370 | return (bool) $value; |
| 1371 | 1371 | } |
| 1372 | 1372 | ); |
@@ -1707,9 +1707,9 @@ discard block |
||
| 1707 | 1707 | |
| 1708 | 1708 | foreach ($items as $key => $value) { |
| 1709 | 1709 | if (\is_array($value) && $value !== []) { |
| 1710 | - $flatten[] = $this->flatten($delimiter, $prepend . $key . $delimiter, $value); |
|
| 1710 | + $flatten[] = $this->flatten($delimiter, $prepend.$key.$delimiter, $value); |
|
| 1711 | 1711 | } else { |
| 1712 | - $flatten[] = [$prepend . $key => $value]; |
|
| 1712 | + $flatten[] = [$prepend.$key => $value]; |
|
| 1713 | 1713 | } |
| 1714 | 1714 | } |
| 1715 | 1715 | |
@@ -1894,7 +1894,7 @@ discard block |
||
| 1894 | 1894 | */ |
| 1895 | 1895 | \array_walk( |
| 1896 | 1896 | $array, |
| 1897 | - static function (&$val) { |
|
| 1897 | + static function(&$val) { |
|
| 1898 | 1898 | if ((string) $val === $val) { |
| 1899 | 1899 | $val = \trim($val); |
| 1900 | 1900 | } |
@@ -2132,7 +2132,7 @@ discard block |
||
| 2132 | 2132 | $array = $array[0]; |
| 2133 | 2133 | } |
| 2134 | 2134 | |
| 2135 | - $generator = function () use ($array): \Generator { |
|
| 2135 | + $generator = function() use ($array): \Generator { |
|
| 2136 | 2136 | foreach ($this->getGenerator() as $key => $value) { |
| 2137 | 2137 | if (\in_array($value, $array, true) === false) { |
| 2138 | 2138 | yield $key => $value; |
@@ -2167,7 +2167,7 @@ discard block |
||
| 2167 | 2167 | $array = $array[0]; |
| 2168 | 2168 | } |
| 2169 | 2169 | |
| 2170 | - $generator = function () use ($array): \Generator { |
|
| 2170 | + $generator = function() use ($array): \Generator { |
|
| 2171 | 2171 | foreach ($this->getGenerator() as $key => $value) { |
| 2172 | 2172 | if (\array_key_exists($key, $array) === false) { |
| 2173 | 2173 | yield $key => $value; |
@@ -2202,7 +2202,7 @@ discard block |
||
| 2202 | 2202 | $array = $array[0]; |
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | - $generator = function () use ($array): \Generator { |
|
| 2205 | + $generator = function() use ($array): \Generator { |
|
| 2206 | 2206 | foreach ($this->getGenerator() as $key => $value) { |
| 2207 | 2207 | $isset = isset($array[$key]); |
| 2208 | 2208 | |
@@ -2511,7 +2511,7 @@ discard block |
||
| 2511 | 2511 | } |
| 2512 | 2512 | |
| 2513 | 2513 | if ($flag === \ARRAY_FILTER_USE_KEY) { |
| 2514 | - $generator = function () use ($closure) { |
|
| 2514 | + $generator = function() use ($closure) { |
|
| 2515 | 2515 | foreach ($this->getGenerator() as $key => $value) { |
| 2516 | 2516 | if ($closure($key) === true) { |
| 2517 | 2517 | yield $key => $value; |
@@ -2523,7 +2523,7 @@ discard block |
||
| 2523 | 2523 | /** @phpstan-var \Closure(T=,TKey=):bool $closure */ |
| 2524 | 2524 | $closure = $closure; |
| 2525 | 2525 | |
| 2526 | - $generator = function () use ($closure) { |
|
| 2526 | + $generator = function() use ($closure) { |
|
| 2527 | 2527 | foreach ($this->getGenerator() as $key => $value) { |
| 2528 | 2528 | if ($closure($value, $key) === true) { |
| 2529 | 2529 | yield $key => $value; |
@@ -2531,7 +2531,7 @@ discard block |
||
| 2531 | 2531 | } |
| 2532 | 2532 | }; |
| 2533 | 2533 | } else { |
| 2534 | - $generator = function () use ($closure) { |
|
| 2534 | + $generator = function() use ($closure) { |
|
| 2535 | 2535 | foreach ($this->getGenerator() as $key => $value) { |
| 2536 | 2536 | if ($closure($value) === true) { |
| 2537 | 2537 | yield $key => $value; |
@@ -2587,40 +2587,40 @@ discard block |
||
| 2587 | 2587 | } |
| 2588 | 2588 | |
| 2589 | 2589 | $ops = [ |
| 2590 | - 'eq' => static function ($item, $prop, $value): bool { |
|
| 2590 | + 'eq' => static function($item, $prop, $value): bool { |
|
| 2591 | 2591 | return $item[$prop] === $value; |
| 2592 | 2592 | }, |
| 2593 | - 'gt' => static function ($item, $prop, $value): bool { |
|
| 2593 | + 'gt' => static function($item, $prop, $value): bool { |
|
| 2594 | 2594 | return $item[$prop] > $value; |
| 2595 | 2595 | }, |
| 2596 | - 'ge' => static function ($item, $prop, $value): bool { |
|
| 2596 | + 'ge' => static function($item, $prop, $value): bool { |
|
| 2597 | 2597 | return $item[$prop] >= $value; |
| 2598 | 2598 | }, |
| 2599 | - 'gte' => static function ($item, $prop, $value): bool { |
|
| 2599 | + 'gte' => static function($item, $prop, $value): bool { |
|
| 2600 | 2600 | return $item[$prop] >= $value; |
| 2601 | 2601 | }, |
| 2602 | - 'lt' => static function ($item, $prop, $value): bool { |
|
| 2602 | + 'lt' => static function($item, $prop, $value): bool { |
|
| 2603 | 2603 | return $item[$prop] < $value; |
| 2604 | 2604 | }, |
| 2605 | - 'le' => static function ($item, $prop, $value): bool { |
|
| 2605 | + 'le' => static function($item, $prop, $value): bool { |
|
| 2606 | 2606 | return $item[$prop] <= $value; |
| 2607 | 2607 | }, |
| 2608 | - 'lte' => static function ($item, $prop, $value): bool { |
|
| 2608 | + 'lte' => static function($item, $prop, $value): bool { |
|
| 2609 | 2609 | return $item[$prop] <= $value; |
| 2610 | 2610 | }, |
| 2611 | - 'ne' => static function ($item, $prop, $value): bool { |
|
| 2611 | + 'ne' => static function($item, $prop, $value): bool { |
|
| 2612 | 2612 | return $item[$prop] !== $value; |
| 2613 | 2613 | }, |
| 2614 | - 'contains' => static function ($item, $prop, $value): bool { |
|
| 2614 | + 'contains' => static function($item, $prop, $value): bool { |
|
| 2615 | 2615 | return \in_array($item[$prop], (array) $value, true); |
| 2616 | 2616 | }, |
| 2617 | - 'notContains' => static function ($item, $prop, $value): bool { |
|
| 2617 | + 'notContains' => static function($item, $prop, $value): bool { |
|
| 2618 | 2618 | return !\in_array($item[$prop], (array) $value, true); |
| 2619 | 2619 | }, |
| 2620 | - 'newer' => static function ($item, $prop, $value): bool { |
|
| 2620 | + 'newer' => static function($item, $prop, $value): bool { |
|
| 2621 | 2621 | return \strtotime($item[$prop]) > \strtotime($value); |
| 2622 | 2622 | }, |
| 2623 | - 'older' => static function ($item, $prop, $value): bool { |
|
| 2623 | + 'older' => static function($item, $prop, $value): bool { |
|
| 2624 | 2624 | return \strtotime($item[$prop]) < \strtotime($value); |
| 2625 | 2625 | }, |
| 2626 | 2626 | ]; |
@@ -2628,7 +2628,7 @@ discard block |
||
| 2628 | 2628 | $result = \array_values( |
| 2629 | 2629 | \array_filter( |
| 2630 | 2630 | $this->toArray(false, true), |
| 2631 | - static function ($item) use ( |
|
| 2631 | + static function($item) use ( |
|
| 2632 | 2632 | $property, |
| 2633 | 2633 | $value, |
| 2634 | 2634 | $ops, |
@@ -2855,7 +2855,7 @@ discard block |
||
| 2855 | 2855 | */ |
| 2856 | 2856 | public function flip(): self |
| 2857 | 2857 | { |
| 2858 | - $generator = function (): \Generator { |
|
| 2858 | + $generator = function(): \Generator { |
|
| 2859 | 2859 | foreach ($this->getGenerator() as $key => $value) { |
| 2860 | 2860 | yield (string) $value => $key; |
| 2861 | 2861 | } |
@@ -3129,9 +3129,9 @@ discard block |
||
| 3129 | 3129 | $jsonObject = \json_decode($json, false); |
| 3130 | 3130 | |
| 3131 | 3131 | $mapper = new \Arrayy\Mapper\Json(); |
| 3132 | - $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($class) { |
|
| 3132 | + $mapper->undefinedPropertyHandler = static function($object, $key, $jsonValue) use ($class) { |
|
| 3133 | 3133 | if ($class->checkPropertiesMismatchInConstructor) { |
| 3134 | - throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object)); |
|
| 3134 | + throw new \TypeError('Property mismatch - input: '.\print_r(['key' => $key, 'jsonValue' => $jsonValue], true).' for object: '.\get_class($object)); |
|
| 3135 | 3135 | } |
| 3136 | 3136 | }; |
| 3137 | 3137 | |
@@ -3196,13 +3196,13 @@ discard block |
||
| 3196 | 3196 | public function getColumn($columnKey = null, $indexKey = null): self |
| 3197 | 3197 | { |
| 3198 | 3198 | if ($columnKey === null && $indexKey === null) { |
| 3199 | - $generator = function () { |
|
| 3199 | + $generator = function() { |
|
| 3200 | 3200 | foreach ($this->getGenerator() as $value) { |
| 3201 | 3201 | yield $value; |
| 3202 | 3202 | } |
| 3203 | 3203 | }; |
| 3204 | 3204 | } else { |
| 3205 | - $generator = function () use ($columnKey, $indexKey) { |
|
| 3205 | + $generator = function() use ($columnKey, $indexKey) { |
|
| 3206 | 3206 | foreach ($this->getGenerator() as $value) { |
| 3207 | 3207 | // reset |
| 3208 | 3208 | $newKey = null; |
@@ -3505,7 +3505,7 @@ discard block |
||
| 3505 | 3505 | |
| 3506 | 3506 | if ($UN_FOUND === null) { |
| 3507 | 3507 | // Generate unique string to use as marker. |
| 3508 | - $UN_FOUND = 'arrayy--' . \uniqid('arrayy', true); |
|
| 3508 | + $UN_FOUND = 'arrayy--'.\uniqid('arrayy', true); |
|
| 3509 | 3509 | } |
| 3510 | 3510 | |
| 3511 | 3511 | if (\is_array($key)) { |
@@ -3557,7 +3557,7 @@ discard block |
||
| 3557 | 3557 | */ |
| 3558 | 3558 | public function implode(string $glue = '', string $prefix = ''): string |
| 3559 | 3559 | { |
| 3560 | - return $prefix . $this->implode_recursive($glue, $this->toArray(), false); |
|
| 3560 | + return $prefix.$this->implode_recursive($glue, $this->toArray(), false); |
|
| 3561 | 3561 | } |
| 3562 | 3562 | |
| 3563 | 3563 | /** |
@@ -3671,7 +3671,7 @@ discard block |
||
| 3671 | 3671 | \array_uintersect( |
| 3672 | 3672 | $this->toArray(), |
| 3673 | 3673 | $search, |
| 3674 | - static function ($a, $b) { |
|
| 3674 | + static function($a, $b) { |
|
| 3675 | 3675 | return $a === $b ? 0 : -1; |
| 3676 | 3676 | } |
| 3677 | 3677 | ), |
@@ -4022,13 +4022,13 @@ discard block |
||
| 4022 | 4022 | // non recursive |
| 4023 | 4023 | |
| 4024 | 4024 | if ($search_values === null) { |
| 4025 | - $arrayFunction = function (): \Generator { |
|
| 4025 | + $arrayFunction = function(): \Generator { |
|
| 4026 | 4026 | foreach ($this->getGenerator() as $key => $value) { |
| 4027 | 4027 | yield $key; |
| 4028 | 4028 | } |
| 4029 | 4029 | }; |
| 4030 | 4030 | } else { |
| 4031 | - $arrayFunction = function () use ($search_values, $strict): \Generator { |
|
| 4031 | + $arrayFunction = function() use ($search_values, $strict): \Generator { |
|
| 4032 | 4032 | $is_array_tmp = \is_array($search_values); |
| 4033 | 4033 | |
| 4034 | 4034 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
@@ -4277,7 +4277,7 @@ discard block |
||
| 4277 | 4277 | $useArguments = \func_num_args() > 2; |
| 4278 | 4278 | |
| 4279 | 4279 | return static::create( |
| 4280 | - function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) { |
|
| 4280 | + function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) { |
|
| 4281 | 4281 | foreach ($this->getGenerator() as $key => $value) { |
| 4282 | 4282 | if ($useArguments) { |
| 4283 | 4283 | if ($useKeyAsSecondParameter) { |
@@ -4779,7 +4779,7 @@ discard block |
||
| 4779 | 4779 | */ |
| 4780 | 4780 | public function nth(int $step, int $offset = 0): self |
| 4781 | 4781 | { |
| 4782 | - $arrayFunction = function () use ($step, $offset): \Generator { |
|
| 4782 | + $arrayFunction = function() use ($step, $offset): \Generator { |
|
| 4783 | 4783 | $position = 0; |
| 4784 | 4784 | foreach ($this->getGenerator() as $key => $value) { |
| 4785 | 4785 | if ($position++ % $step !== $offset) { |
@@ -4813,7 +4813,7 @@ discard block |
||
| 4813 | 4813 | { |
| 4814 | 4814 | $keys = \array_flip($keys); |
| 4815 | 4815 | |
| 4816 | - $generator = function () use ($keys): \Generator { |
|
| 4816 | + $generator = function() use ($keys): \Generator { |
|
| 4817 | 4817 | foreach ($this->getGenerator() as $key => $value) { |
| 4818 | 4818 | if (isset($keys[$key])) { |
| 4819 | 4819 | yield $key => $value; |
@@ -4950,7 +4950,7 @@ discard block |
||
| 4950 | 4950 | */ |
| 4951 | 4951 | public function prependImmutable($value, $key = null) |
| 4952 | 4952 | { |
| 4953 | - $generator = function () use ($key, $value): \Generator { |
|
| 4953 | + $generator = function() use ($key, $value): \Generator { |
|
| 4954 | 4954 | if ($this->properties !== []) { |
| 4955 | 4955 | $this->checkType($key, $value); |
| 4956 | 4956 | } |
@@ -5000,7 +5000,7 @@ discard block |
||
| 5000 | 5000 | )->prependToEachKey($suffix) |
| 5001 | 5001 | ->toArray(); |
| 5002 | 5002 | } else { |
| 5003 | - $result[$key . $suffix] = $item; |
|
| 5003 | + $result[$key.$suffix] = $item; |
|
| 5004 | 5004 | } |
| 5005 | 5005 | } |
| 5006 | 5006 | |
@@ -5040,7 +5040,7 @@ discard block |
||
| 5040 | 5040 | } elseif (\is_object($item) === true) { |
| 5041 | 5041 | $result[$key] = $item; |
| 5042 | 5042 | } else { |
| 5043 | - $result[$key] = $item . $suffix; |
|
| 5043 | + $result[$key] = $item.$suffix; |
|
| 5044 | 5044 | } |
| 5045 | 5045 | } |
| 5046 | 5046 | |
@@ -5849,7 +5849,7 @@ discard block |
||
| 5849 | 5849 | */ |
| 5850 | 5850 | public function replaceValues($search, $replacement = ''): self |
| 5851 | 5851 | { |
| 5852 | - $callable = static function ($value) use ($search, $replacement) { |
|
| 5852 | + $callable = static function($value) use ($search, $replacement) { |
|
| 5853 | 5853 | return \str_replace($search, $replacement, $value); |
| 5854 | 5854 | }; |
| 5855 | 5855 | |
@@ -6545,7 +6545,7 @@ discard block |
||
| 6545 | 6545 | * @psalm-suppress MissingClosureParamType |
| 6546 | 6546 | */ |
| 6547 | 6547 | $results = $arrayy->each( |
| 6548 | - static function ($value) use ($sorter) { |
|
| 6548 | + static function($value) use ($sorter) { |
|
| 6549 | 6549 | if (\is_callable($sorter) === true) { |
| 6550 | 6550 | return $sorter($value); |
| 6551 | 6551 | } |
@@ -6618,7 +6618,7 @@ discard block |
||
| 6618 | 6618 | public function split(int $numberOfPieces = 2, bool $keepKeys = false): self |
| 6619 | 6619 | { |
| 6620 | 6620 | if ($keepKeys) { |
| 6621 | - $generator = function () use ($numberOfPieces) { |
|
| 6621 | + $generator = function() use ($numberOfPieces) { |
|
| 6622 | 6622 | $carry = []; |
| 6623 | 6623 | $i = 1; |
| 6624 | 6624 | foreach ($this->getGenerator() as $key => $value) { |
@@ -6641,7 +6641,7 @@ discard block |
||
| 6641 | 6641 | } |
| 6642 | 6642 | }; |
| 6643 | 6643 | } else { |
| 6644 | - $generator = function () use ($numberOfPieces) { |
|
| 6644 | + $generator = function() use ($numberOfPieces) { |
|
| 6645 | 6645 | $carry = []; |
| 6646 | 6646 | $i = 1; |
| 6647 | 6647 | foreach ($this->getGenerator() as $value) { |
@@ -6688,7 +6688,7 @@ discard block |
||
| 6688 | 6688 | public function stripEmpty(): self |
| 6689 | 6689 | { |
| 6690 | 6690 | return $this->filter( |
| 6691 | - static function ($item) { |
|
| 6691 | + static function($item) { |
|
| 6692 | 6692 | if ($item === null) { |
| 6693 | 6693 | return false; |
| 6694 | 6694 | } |
@@ -6892,7 +6892,7 @@ discard block |
||
| 6892 | 6892 | // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array |
| 6893 | 6893 | |
| 6894 | 6894 | $this->array = $this->reduce( |
| 6895 | - static function ($resultArray, $value, $key) { |
|
| 6895 | + static function($resultArray, $value, $key) { |
|
| 6896 | 6896 | if (!\in_array($value, $resultArray, true)) { |
| 6897 | 6897 | $resultArray[] = $value; |
| 6898 | 6898 | } |
@@ -6931,7 +6931,7 @@ discard block |
||
| 6931 | 6931 | */ |
| 6932 | 6932 | $this->array = \array_reduce( |
| 6933 | 6933 | \array_keys($array), |
| 6934 | - static function ($resultArray, $key) use ($array) { |
|
| 6934 | + static function($resultArray, $key) use ($array) { |
|
| 6935 | 6935 | if (!\in_array($array[$key], $resultArray, true)) { |
| 6936 | 6936 | $resultArray[$key] = $array[$key]; |
| 6937 | 6937 | } |
@@ -7028,7 +7028,7 @@ discard block |
||
| 7028 | 7028 | public function values(): self |
| 7029 | 7029 | { |
| 7030 | 7030 | return static::create( |
| 7031 | - function () { |
|
| 7031 | + function() { |
|
| 7032 | 7032 | foreach ($this->getGenerator() as $value) { |
| 7033 | 7033 | yield $value; |
| 7034 | 7034 | } |
@@ -7112,7 +7112,7 @@ discard block |
||
| 7112 | 7112 | public function where(string $keyOrPropertyOrMethod, $value): self |
| 7113 | 7113 | { |
| 7114 | 7114 | return $this->filter( |
| 7115 | - function ($item) use ($keyOrPropertyOrMethod, $value) { |
|
| 7115 | + function($item) use ($keyOrPropertyOrMethod, $value) { |
|
| 7116 | 7116 | $accessorValue = $this->extractValue( |
| 7117 | 7117 | $item, |
| 7118 | 7118 | $keyOrPropertyOrMethod |
@@ -7407,7 +7407,7 @@ discard block |
||
| 7407 | 7407 | protected function getPropertiesFromPhpDoc() |
| 7408 | 7408 | { |
| 7409 | 7409 | static $PROPERTY_CACHE = []; |
| 7410 | - $cacheKey = 'Class::' . static::class; |
|
| 7410 | + $cacheKey = 'Class::'.static::class; |
|
| 7411 | 7411 | |
| 7412 | 7412 | if (isset($PROPERTY_CACHE[$cacheKey])) { |
| 7413 | 7413 | return $PROPERTY_CACHE[$cacheKey]; |
@@ -7717,7 +7717,7 @@ discard block |
||
| 7717 | 7717 | if ($array === null) { |
| 7718 | 7718 | $array = []; |
| 7719 | 7719 | } elseif (!\is_array($array)) { |
| 7720 | - throw new \RuntimeException('Can not set value at this path "' . $key . '" because (' . \gettype($array) . ')"' . \print_r($array, true) . '" is not an array.'); |
|
| 7720 | + throw new \RuntimeException('Can not set value at this path "'.$key.'" because ('.\gettype($array).')"'.\print_r($array, true).'" is not an array.'); |
|
| 7721 | 7721 | } |
| 7722 | 7722 | |
| 7723 | 7723 | $array[$key] = $value; |
@@ -7789,7 +7789,7 @@ discard block |
||
| 7789 | 7789 | && |
| 7790 | 7790 | \count(\array_diff_key($properties, $data)) > 0 |
| 7791 | 7791 | ) { |
| 7792 | - throw new \TypeError('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($properties), true)); |
|
| 7792 | + throw new \TypeError('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($properties), true)); |
|
| 7793 | 7793 | } |
| 7794 | 7794 | |
| 7795 | 7795 | foreach ($data as $key => &$valueInner) { |
@@ -7906,7 +7906,7 @@ discard block |
||
| 7906 | 7906 | * |
| 7907 | 7907 | * @return void |
| 7908 | 7908 | */ |
| 7909 | - static function (&$item) { |
|
| 7909 | + static function(&$item) { |
|
| 7910 | 7910 | if ($item instanceof self) { |
| 7911 | 7911 | $item = $item->getArray(); |
| 7912 | 7912 | } |
@@ -7931,7 +7931,7 @@ discard block |
||
| 7931 | 7931 | && |
| 7932 | 7932 | $this->checkPropertiesMismatch === true |
| 7933 | 7933 | ) { |
| 7934 | - throw new \TypeError('The key "' . $key . '" does not exists as "@property" phpdoc. (' . \get_class($this) . ').'); |
|
| 7934 | + throw new \TypeError('The key "'.$key.'" does not exists as "@property" phpdoc. ('.\get_class($this).').'); |
|
| 7935 | 7935 | } |
| 7936 | 7936 | |
| 7937 | 7937 | if (isset($this->properties[self::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES])) { |