@@ -4896,7 +4896,7 @@ discard block |
||
4896 | 4896 | } |
4897 | 4897 | |
4898 | 4898 | /** |
4899 | - * @param mixed $path |
|
4899 | + * @param string $path |
|
4900 | 4900 | * @param callable $callable |
4901 | 4901 | * @param array|null $currentOffset |
4902 | 4902 | * |
@@ -5039,7 +5039,7 @@ discard block |
||
5039 | 5039 | } |
5040 | 5040 | |
5041 | 5041 | /** |
5042 | - * @param mixed $glue |
|
5042 | + * @param string $glue |
|
5043 | 5043 | * @param mixed $pieces |
5044 | 5044 | * @param bool $useKeys |
5045 | 5045 | * |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | |
465 | 465 | $this->callAtPath( |
466 | 466 | $containerPath, |
467 | - static function ($container) use ($lastOffset, &$offsetExists) { |
|
467 | + static function($container) use ($lastOffset, &$offsetExists) { |
|
468 | 468 | $offsetExists = \array_key_exists($lastOffset, $container); |
469 | 469 | } |
470 | 470 | ); |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | |
551 | 551 | $this->callAtPath( |
552 | 552 | \implode($this->pathSeparator, $path), |
553 | - static function (&$offset) use ($pathToUnset) { |
|
553 | + static function(&$offset) use ($pathToUnset) { |
|
554 | 554 | unset($offset[$pathToUnset]); |
555 | 555 | } |
556 | 556 | ); |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | } |
595 | 595 | |
596 | 596 | if (\strpos($class, '\\') === 0) { |
597 | - $class = '\\' . $class; |
|
597 | + $class = '\\'.$class; |
|
598 | 598 | if (\class_exists($class)) { |
599 | 599 | $this->iteratorClass = $class; |
600 | 600 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | } |
603 | 603 | } |
604 | 604 | |
605 | - throw new \InvalidArgumentException('The iterator class does not exist: ' . $class); |
|
605 | + throw new \InvalidArgumentException('The iterator class does not exist: '.$class); |
|
606 | 606 | } |
607 | 607 | |
608 | 608 | /** |
@@ -712,13 +712,13 @@ discard block |
||
712 | 712 | |
713 | 713 | foreach ($this->getGenerator() as $key => $item) { |
714 | 714 | if ($item instanceof self) { |
715 | - $result[$prefix . $key] = $item->appendToEachKey($prefix); |
|
715 | + $result[$prefix.$key] = $item->appendToEachKey($prefix); |
|
716 | 716 | } elseif (\is_array($item) === true) { |
717 | - $result[$prefix . $key] = self::create($item, $this->iteratorClass, false) |
|
717 | + $result[$prefix.$key] = self::create($item, $this->iteratorClass, false) |
|
718 | 718 | ->appendToEachKey($prefix) |
719 | 719 | ->toArray(); |
720 | 720 | } else { |
721 | - $result[$prefix . $key] = $item; |
|
721 | + $result[$prefix.$key] = $item; |
|
722 | 722 | } |
723 | 723 | } |
724 | 724 | |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | } elseif (\is_object($item) === true) { |
747 | 747 | $result[$key] = $item; |
748 | 748 | } else { |
749 | - $result[$key] = $prefix . $item; |
|
749 | + $result[$key] = $prefix.$item; |
|
750 | 750 | } |
751 | 751 | } |
752 | 752 | |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | public function clean(): self |
896 | 896 | { |
897 | 897 | return $this->filter( |
898 | - static function ($value) { |
|
898 | + static function($value) { |
|
899 | 899 | return (bool) $value; |
900 | 900 | } |
901 | 901 | ); |
@@ -1258,7 +1258,7 @@ discard block |
||
1258 | 1258 | // trim all string in the array |
1259 | 1259 | \array_walk( |
1260 | 1260 | $array, |
1261 | - static function (&$val) { |
|
1261 | + static function(&$val) { |
|
1262 | 1262 | if ((string) $val === $val) { |
1263 | 1263 | $val = \trim($val); |
1264 | 1264 | } |
@@ -1667,40 +1667,40 @@ discard block |
||
1667 | 1667 | } |
1668 | 1668 | |
1669 | 1669 | $ops = [ |
1670 | - 'eq' => static function ($item, $prop, $value): bool { |
|
1670 | + 'eq' => static function($item, $prop, $value): bool { |
|
1671 | 1671 | return $item[$prop] === $value; |
1672 | 1672 | }, |
1673 | - 'gt' => static function ($item, $prop, $value): bool { |
|
1673 | + 'gt' => static function($item, $prop, $value): bool { |
|
1674 | 1674 | return $item[$prop] > $value; |
1675 | 1675 | }, |
1676 | - 'ge' => static function ($item, $prop, $value): bool { |
|
1676 | + 'ge' => static function($item, $prop, $value): bool { |
|
1677 | 1677 | return $item[$prop] >= $value; |
1678 | 1678 | }, |
1679 | - 'gte' => static function ($item, $prop, $value): bool { |
|
1679 | + 'gte' => static function($item, $prop, $value): bool { |
|
1680 | 1680 | return $item[$prop] >= $value; |
1681 | 1681 | }, |
1682 | - 'lt' => static function ($item, $prop, $value): bool { |
|
1682 | + 'lt' => static function($item, $prop, $value): bool { |
|
1683 | 1683 | return $item[$prop] < $value; |
1684 | 1684 | }, |
1685 | - 'le' => static function ($item, $prop, $value): bool { |
|
1685 | + 'le' => static function($item, $prop, $value): bool { |
|
1686 | 1686 | return $item[$prop] <= $value; |
1687 | 1687 | }, |
1688 | - 'lte' => static function ($item, $prop, $value): bool { |
|
1688 | + 'lte' => static function($item, $prop, $value): bool { |
|
1689 | 1689 | return $item[$prop] <= $value; |
1690 | 1690 | }, |
1691 | - 'ne' => static function ($item, $prop, $value): bool { |
|
1691 | + 'ne' => static function($item, $prop, $value): bool { |
|
1692 | 1692 | return $item[$prop] !== $value; |
1693 | 1693 | }, |
1694 | - 'contains' => static function ($item, $prop, $value): bool { |
|
1694 | + 'contains' => static function($item, $prop, $value): bool { |
|
1695 | 1695 | return \in_array($item[$prop], (array) $value, true); |
1696 | 1696 | }, |
1697 | - 'notContains' => static function ($item, $prop, $value): bool { |
|
1697 | + 'notContains' => static function($item, $prop, $value): bool { |
|
1698 | 1698 | return !\in_array($item[$prop], (array) $value, true); |
1699 | 1699 | }, |
1700 | - 'newer' => static function ($item, $prop, $value): bool { |
|
1700 | + 'newer' => static function($item, $prop, $value): bool { |
|
1701 | 1701 | return \strtotime($item[$prop]) > \strtotime($value); |
1702 | 1702 | }, |
1703 | - 'older' => static function ($item, $prop, $value): bool { |
|
1703 | + 'older' => static function($item, $prop, $value): bool { |
|
1704 | 1704 | return \strtotime($item[$prop]) < \strtotime($value); |
1705 | 1705 | }, |
1706 | 1706 | ]; |
@@ -1708,7 +1708,7 @@ discard block |
||
1708 | 1708 | $result = \array_values( |
1709 | 1709 | \array_filter( |
1710 | 1710 | $this->getArray(), |
1711 | - static function ($item) use ( |
|
1711 | + static function($item) use ( |
|
1712 | 1712 | $property, |
1713 | 1713 | $value, |
1714 | 1714 | $ops, |
@@ -2386,7 +2386,7 @@ discard block |
||
2386 | 2386 | \array_uintersect( |
2387 | 2387 | $this->array, |
2388 | 2388 | $search, |
2389 | - static function ($a, $b) { |
|
2389 | + static function($a, $b) { |
|
2390 | 2390 | return $a === $b ? 0 : -1; |
2391 | 2391 | } |
2392 | 2392 | ), |
@@ -2666,7 +2666,7 @@ discard block |
||
2666 | 2666 | * |
2667 | 2667 | * @phpstan-return \Generator<int, mixed, mixed, void> |
2668 | 2668 | */ |
2669 | - function (): \Generator { |
|
2669 | + function(): \Generator { |
|
2670 | 2670 | foreach ($this->getGenerator() as $key => $value) { |
2671 | 2671 | yield $key; |
2672 | 2672 | } |
@@ -2677,7 +2677,7 @@ discard block |
||
2677 | 2677 | * |
2678 | 2678 | * @phpstan-return \Generator<int, mixed, mixed, void> |
2679 | 2679 | */ |
2680 | - function () use ($search_values, $strict): \Generator { |
|
2680 | + function() use ($search_values, $strict): \Generator { |
|
2681 | 2681 | $is_array_tmp = \is_array($search_values); |
2682 | 2682 | |
2683 | 2683 | foreach ($this->getGenerator() as $key => $value) { |
@@ -2877,7 +2877,7 @@ discard block |
||
2877 | 2877 | $useArguments = \func_num_args() > 2; |
2878 | 2878 | |
2879 | 2879 | return static::create( |
2880 | - function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) { |
|
2880 | + function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) { |
|
2881 | 2881 | foreach ($this->getGenerator() as $key => $value) { |
2882 | 2882 | if ($useArguments) { |
2883 | 2883 | if ($useKeyAsSecondParameter) { |
@@ -3354,7 +3354,7 @@ discard block |
||
3354 | 3354 | )->prependToEachKey($suffix) |
3355 | 3355 | ->toArray(); |
3356 | 3356 | } else { |
3357 | - $result[$key . $suffix] = $item; |
|
3357 | + $result[$key.$suffix] = $item; |
|
3358 | 3358 | } |
3359 | 3359 | } |
3360 | 3360 | |
@@ -3391,7 +3391,7 @@ discard block |
||
3391 | 3391 | } elseif (\is_object($item) === true) { |
3392 | 3392 | $result[$key] = $item; |
3393 | 3393 | } else { |
3394 | - $result[$key] = $item . $suffix; |
|
3394 | + $result[$key] = $item.$suffix; |
|
3395 | 3395 | } |
3396 | 3396 | } |
3397 | 3397 | |
@@ -4001,7 +4001,7 @@ discard block |
||
4001 | 4001 | public function replaceValues($search, $replacement = ''): self |
4002 | 4002 | { |
4003 | 4003 | return $this->each( |
4004 | - static function ($value) use ($search, $replacement) { |
|
4004 | + static function($value) use ($search, $replacement) { |
|
4005 | 4005 | return \str_replace($search, $replacement, $value); |
4006 | 4006 | } |
4007 | 4007 | ); |
@@ -4499,7 +4499,7 @@ discard block |
||
4499 | 4499 | ); |
4500 | 4500 | |
4501 | 4501 | $results = $arrayy->each( |
4502 | - function ($value) use ($sorter) { |
|
4502 | + function($value) use ($sorter) { |
|
4503 | 4503 | if (\is_callable($sorter) === true) { |
4504 | 4504 | return $sorter($value); |
4505 | 4505 | } |
@@ -4582,7 +4582,7 @@ discard block |
||
4582 | 4582 | public function stripEmpty(): self |
4583 | 4583 | { |
4584 | 4584 | return $this->filter( |
4585 | - static function ($item) { |
|
4585 | + static function($item) { |
|
4586 | 4586 | if ($item === null) { |
4587 | 4587 | return false; |
4588 | 4588 | } |
@@ -4670,7 +4670,7 @@ discard block |
||
4670 | 4670 | // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array |
4671 | 4671 | |
4672 | 4672 | $this->array = $this->reduce( |
4673 | - static function ($resultArray, $value) { |
|
4673 | + static function($resultArray, $value) { |
|
4674 | 4674 | if (!\in_array($value, $resultArray, true)) { |
4675 | 4675 | $resultArray[] = $value; |
4676 | 4676 | } |
@@ -4699,7 +4699,7 @@ discard block |
||
4699 | 4699 | |
4700 | 4700 | $this->array = \array_reduce( |
4701 | 4701 | \array_keys($array), |
4702 | - static function ($resultArray, $key) use ($array) { |
|
4702 | + static function($resultArray, $key) use ($array) { |
|
4703 | 4703 | if (!\in_array($array[$key], $resultArray, true)) { |
4704 | 4704 | $resultArray[$key] = $array[$key]; |
4705 | 4705 | } |
@@ -4758,7 +4758,7 @@ discard block |
||
4758 | 4758 | public function values(): self |
4759 | 4759 | { |
4760 | 4760 | return static::create( |
4761 | - function () { |
|
4761 | + function() { |
|
4762 | 4762 | /** @noinspection YieldFromCanBeUsedInspection */ |
4763 | 4763 | foreach ($this->getGenerator() as $value) { |
4764 | 4764 | yield $value; |
@@ -5015,7 +5015,7 @@ discard block |
||
5015 | 5015 | protected function getPropertiesFromPhpDoc() |
5016 | 5016 | { |
5017 | 5017 | static $PROPERTY_CACHE = []; |
5018 | - $cacheKey = 'Class::' . static::class; |
|
5018 | + $cacheKey = 'Class::'.static::class; |
|
5019 | 5019 | |
5020 | 5020 | if (isset($PROPERTY_CACHE[$cacheKey])) { |
5021 | 5021 | return $PROPERTY_CACHE[$cacheKey]; |
@@ -5330,7 +5330,7 @@ discard block |
||
5330 | 5330 | && |
5331 | 5331 | \count(\array_diff_key($this->properties, $data)) > 0 |
5332 | 5332 | ) { |
5333 | - throw new \TypeError('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($this->properties), true)); |
|
5333 | + throw new \TypeError('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($this->properties), true)); |
|
5334 | 5334 | } |
5335 | 5335 | |
5336 | 5336 | foreach ($data as $key => &$valueInner) { |
@@ -5427,7 +5427,7 @@ discard block |
||
5427 | 5427 | && |
5428 | 5428 | $this->checkPropertiesMismatch === true |
5429 | 5429 | ) { |
5430 | - throw new \TypeError('The key ' . $key . ' does not exists in "properties". Maybe because @property was not used for the class (' . \get_class($this) . ').'); |
|
5430 | + throw new \TypeError('The key '.$key.' does not exists in "properties". Maybe because @property was not used for the class ('.\get_class($this).').'); |
|
5431 | 5431 | } |
5432 | 5432 | |
5433 | 5433 | if (isset($this->properties[self::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES])) { |
@@ -242,6 +242,7 @@ |
||
242 | 242 | * Merge current items and items of given collections into a new one. |
243 | 243 | * |
244 | 244 | * @param self ...$collections The collections to merge. |
245 | + * @param \self[] $collections |
|
245 | 246 | * |
246 | 247 | * @throws \InvalidArgumentException if any of the given collections are not of the same type |
247 | 248 | * |
@@ -205,7 +205,7 @@ |
||
205 | 205 | public function where(string $keyOrPropertyOrMethod, $value): self |
206 | 206 | { |
207 | 207 | return $this->filter( |
208 | - function ($item) use ($keyOrPropertyOrMethod, $value) { |
|
208 | + function($item) use ($keyOrPropertyOrMethod, $value) { |
|
209 | 209 | $accessorValue = $this->extractValue( |
210 | 210 | $item, |
211 | 211 | $keyOrPropertyOrMethod |