@@ -1694,11 +1694,11 @@ discard block |
||
1694 | 1694 | ), |
1695 | 1695 | \COUNT_NORMAL |
1696 | 1696 | ) |
1697 | - === |
|
1698 | - \count( |
|
1699 | - $needles, |
|
1700 | - \COUNT_NORMAL |
|
1701 | - ); |
|
1697 | + === |
|
1698 | + \count( |
|
1699 | + $needles, |
|
1700 | + \COUNT_NORMAL |
|
1701 | + ); |
|
1702 | 1702 | } |
1703 | 1703 | |
1704 | 1704 | /** |
@@ -6907,7 +6907,7 @@ discard block |
||
6907 | 6907 | |
6908 | 6908 | /** @phpstan-ignore-next-line - depends on the $convertAllArrayyElements parameter :/ */ |
6909 | 6909 | return $array; |
6910 | - } |
|
6910 | + } |
|
6911 | 6911 | |
6912 | 6912 | return \iterator_to_array($this->getGenerator(), $preserveKeys); |
6913 | 6913 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | /** |
349 | 349 | * @phpstan-return \Generator<TKey,T> $generator |
350 | 350 | */ |
351 | - $generator = function () use ($key, $value): \Generator { |
|
351 | + $generator = function() use ($key, $value): \Generator { |
|
352 | 352 | if ($this->properties !== []) { |
353 | 353 | $this->checkType($key, $value); |
354 | 354 | } |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | |
538 | 538 | /** @phpstan-var \Arrayy\ArrayyRewindableGenerator<TKey,T> */ |
539 | 539 | $generatorTmp = new ArrayyRewindableExtendedGenerator( |
540 | - static function () use ($generator): \Generator { |
|
540 | + static function() use ($generator): \Generator { |
|
541 | 541 | yield from $generator; |
542 | 542 | }, |
543 | 543 | null, |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | */ |
750 | 750 | $this->callAtPath( |
751 | 751 | $containerPath, |
752 | - static function ($container) use ($lastOffset, &$offsetExists) { |
|
752 | + static function($container) use ($lastOffset, &$offsetExists) { |
|
753 | 753 | $offsetExists = \array_key_exists($lastOffset, $container); |
754 | 754 | } |
755 | 755 | ); |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | */ |
858 | 858 | $this->callAtPath( |
859 | 859 | \implode($this->pathSeparator, $path), |
860 | - static function (&$offset) use ($pathToUnset) { |
|
860 | + static function(&$offset) use ($pathToUnset) { |
|
861 | 861 | if (\is_array($offset)) { |
862 | 862 | unset($offset[$pathToUnset]); |
863 | 863 | } else { |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | |
914 | 914 | if (\strpos($iteratorClass, '\\') === 0) { |
915 | 915 | /** @var class-string<\Arrayy\ArrayyIterator<TKey,T>> $iteratorClass */ |
916 | - $iteratorClass = '\\' . $iteratorClass; |
|
916 | + $iteratorClass = '\\'.$iteratorClass; |
|
917 | 917 | if (\class_exists($iteratorClass)) { |
918 | 918 | /** |
919 | 919 | * @psalm-suppress PropertyTypeCoercion |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | } |
925 | 925 | } |
926 | 926 | |
927 | - throw new \InvalidArgumentException('The iterator class does not exist: ' . $iteratorClass); |
|
927 | + throw new \InvalidArgumentException('The iterator class does not exist: '.$iteratorClass); |
|
928 | 928 | } |
929 | 929 | |
930 | 930 | /** |
@@ -1106,13 +1106,13 @@ discard block |
||
1106 | 1106 | |
1107 | 1107 | foreach ($this->getGenerator() as $key => $item) { |
1108 | 1108 | if ($item instanceof self) { |
1109 | - $result[$prefix . $key] = $item->appendToEachKey($prefix); |
|
1109 | + $result[$prefix.$key] = $item->appendToEachKey($prefix); |
|
1110 | 1110 | } elseif (\is_array($item)) { |
1111 | - $result[$prefix . $key] = self::create($item, $this->iteratorClass, false) |
|
1111 | + $result[$prefix.$key] = self::create($item, $this->iteratorClass, false) |
|
1112 | 1112 | ->appendToEachKey($prefix) |
1113 | 1113 | ->toArray(); |
1114 | 1114 | } else { |
1115 | - $result[$prefix . $key] = $item; |
|
1115 | + $result[$prefix.$key] = $item; |
|
1116 | 1116 | } |
1117 | 1117 | } |
1118 | 1118 | |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | } elseif (\is_object($item) === true) { |
1148 | 1148 | $result[$key] = $item; |
1149 | 1149 | } else { |
1150 | - $result[$key] = $prefix . $item; |
|
1150 | + $result[$key] = $prefix.$item; |
|
1151 | 1151 | } |
1152 | 1152 | } |
1153 | 1153 | |
@@ -1332,7 +1332,7 @@ discard block |
||
1332 | 1332 | public function chunk($size, $preserveKeys = false): self |
1333 | 1333 | { |
1334 | 1334 | if ($preserveKeys) { |
1335 | - $generator = function () use ($size) { |
|
1335 | + $generator = function() use ($size) { |
|
1336 | 1336 | $values = []; |
1337 | 1337 | $tmpCounter = 0; |
1338 | 1338 | foreach ($this->getGenerator() as $key => $value) { |
@@ -1352,7 +1352,7 @@ discard block |
||
1352 | 1352 | } |
1353 | 1353 | }; |
1354 | 1354 | } else { |
1355 | - $generator = function () use ($size) { |
|
1355 | + $generator = function() use ($size) { |
|
1356 | 1356 | $values = []; |
1357 | 1357 | $tmpCounter = 0; |
1358 | 1358 | foreach ($this->getGenerator() as $value) { |
@@ -1396,7 +1396,7 @@ discard block |
||
1396 | 1396 | public function clean(): self |
1397 | 1397 | { |
1398 | 1398 | return $this->filter( |
1399 | - static function ($value) { |
|
1399 | + static function($value) { |
|
1400 | 1400 | return (bool) $value; |
1401 | 1401 | } |
1402 | 1402 | ); |
@@ -1777,9 +1777,9 @@ discard block |
||
1777 | 1777 | |
1778 | 1778 | foreach ($items as $key => $value) { |
1779 | 1779 | if (\is_array($value) && $value !== []) { |
1780 | - $flatten[] = $this->flatten($delimiter, $prepend . $key . $delimiter, $value); |
|
1780 | + $flatten[] = $this->flatten($delimiter, $prepend.$key.$delimiter, $value); |
|
1781 | 1781 | } else { |
1782 | - $flatten[] = [$prepend . $key => $value]; |
|
1782 | + $flatten[] = [$prepend.$key => $value]; |
|
1783 | 1783 | } |
1784 | 1784 | } |
1785 | 1785 | |
@@ -1964,7 +1964,7 @@ discard block |
||
1964 | 1964 | */ |
1965 | 1965 | \array_walk( |
1966 | 1966 | $array, |
1967 | - static function (&$val) { |
|
1967 | + static function(&$val) { |
|
1968 | 1968 | if ((string) $val === $val) { |
1969 | 1969 | $val = \trim($val); |
1970 | 1970 | } |
@@ -2200,7 +2200,7 @@ discard block |
||
2200 | 2200 | $array = $array[0]; |
2201 | 2201 | } |
2202 | 2202 | |
2203 | - $generator = function () use ($array): \Generator { |
|
2203 | + $generator = function() use ($array): \Generator { |
|
2204 | 2204 | foreach ($this->getGenerator() as $key => $value) { |
2205 | 2205 | if (\in_array($value, $array, true) === false) { |
2206 | 2206 | yield $key => $value; |
@@ -2235,7 +2235,7 @@ discard block |
||
2235 | 2235 | $array = $array[0]; |
2236 | 2236 | } |
2237 | 2237 | |
2238 | - $generator = function () use ($array): \Generator { |
|
2238 | + $generator = function() use ($array): \Generator { |
|
2239 | 2239 | foreach ($this->getGenerator() as $key => $value) { |
2240 | 2240 | if (\array_key_exists($key, $array) === false) { |
2241 | 2241 | yield $key => $value; |
@@ -2270,7 +2270,7 @@ discard block |
||
2270 | 2270 | $array = $array[0]; |
2271 | 2271 | } |
2272 | 2272 | |
2273 | - $generator = function () use ($array): \Generator { |
|
2273 | + $generator = function() use ($array): \Generator { |
|
2274 | 2274 | foreach ($this->getGenerator() as $key => $value) { |
2275 | 2275 | $isset = isset($array[$key]); |
2276 | 2276 | |
@@ -2579,7 +2579,7 @@ discard block |
||
2579 | 2579 | } |
2580 | 2580 | |
2581 | 2581 | if ($flag === \ARRAY_FILTER_USE_KEY) { |
2582 | - $generator = function () use ($closure) { |
|
2582 | + $generator = function() use ($closure) { |
|
2583 | 2583 | foreach ($this->getGenerator() as $key => $value) { |
2584 | 2584 | if ($closure($key) === true) { |
2585 | 2585 | yield $key => $value; |
@@ -2591,7 +2591,7 @@ discard block |
||
2591 | 2591 | /** @phpstan-var \Closure(T=,TKey=):bool $closure */ |
2592 | 2592 | $closure = $closure; |
2593 | 2593 | |
2594 | - $generator = function () use ($closure) { |
|
2594 | + $generator = function() use ($closure) { |
|
2595 | 2595 | foreach ($this->getGenerator() as $key => $value) { |
2596 | 2596 | if ($closure($value, $key) === true) { |
2597 | 2597 | yield $key => $value; |
@@ -2599,7 +2599,7 @@ discard block |
||
2599 | 2599 | } |
2600 | 2600 | }; |
2601 | 2601 | } else { |
2602 | - $generator = function () use ($closure) { |
|
2602 | + $generator = function() use ($closure) { |
|
2603 | 2603 | foreach ($this->getGenerator() as $key => $value) { |
2604 | 2604 | if ($closure($value) === true) { |
2605 | 2605 | yield $key => $value; |
@@ -2655,40 +2655,40 @@ discard block |
||
2655 | 2655 | } |
2656 | 2656 | |
2657 | 2657 | $ops = [ |
2658 | - 'eq' => static function ($item, $prop, $value): bool { |
|
2658 | + 'eq' => static function($item, $prop, $value): bool { |
|
2659 | 2659 | return $item[$prop] === $value; |
2660 | 2660 | }, |
2661 | - 'gt' => static function ($item, $prop, $value): bool { |
|
2661 | + 'gt' => static function($item, $prop, $value): bool { |
|
2662 | 2662 | return $item[$prop] > $value; |
2663 | 2663 | }, |
2664 | - 'ge' => static function ($item, $prop, $value): bool { |
|
2664 | + 'ge' => static function($item, $prop, $value): bool { |
|
2665 | 2665 | return $item[$prop] >= $value; |
2666 | 2666 | }, |
2667 | - 'gte' => static function ($item, $prop, $value): bool { |
|
2667 | + 'gte' => static function($item, $prop, $value): bool { |
|
2668 | 2668 | return $item[$prop] >= $value; |
2669 | 2669 | }, |
2670 | - 'lt' => static function ($item, $prop, $value): bool { |
|
2670 | + 'lt' => static function($item, $prop, $value): bool { |
|
2671 | 2671 | return $item[$prop] < $value; |
2672 | 2672 | }, |
2673 | - 'le' => static function ($item, $prop, $value): bool { |
|
2673 | + 'le' => static function($item, $prop, $value): bool { |
|
2674 | 2674 | return $item[$prop] <= $value; |
2675 | 2675 | }, |
2676 | - 'lte' => static function ($item, $prop, $value): bool { |
|
2676 | + 'lte' => static function($item, $prop, $value): bool { |
|
2677 | 2677 | return $item[$prop] <= $value; |
2678 | 2678 | }, |
2679 | - 'ne' => static function ($item, $prop, $value): bool { |
|
2679 | + 'ne' => static function($item, $prop, $value): bool { |
|
2680 | 2680 | return $item[$prop] !== $value; |
2681 | 2681 | }, |
2682 | - 'contains' => static function ($item, $prop, $value): bool { |
|
2682 | + 'contains' => static function($item, $prop, $value): bool { |
|
2683 | 2683 | return \in_array($item[$prop], (array) $value, true); |
2684 | 2684 | }, |
2685 | - 'notContains' => static function ($item, $prop, $value): bool { |
|
2685 | + 'notContains' => static function($item, $prop, $value): bool { |
|
2686 | 2686 | return !\in_array($item[$prop], (array) $value, true); |
2687 | 2687 | }, |
2688 | - 'newer' => static function ($item, $prop, $value): bool { |
|
2688 | + 'newer' => static function($item, $prop, $value): bool { |
|
2689 | 2689 | return \strtotime($item[$prop]) > \strtotime($value); |
2690 | 2690 | }, |
2691 | - 'older' => static function ($item, $prop, $value): bool { |
|
2691 | + 'older' => static function($item, $prop, $value): bool { |
|
2692 | 2692 | return \strtotime($item[$prop]) < \strtotime($value); |
2693 | 2693 | }, |
2694 | 2694 | ]; |
@@ -2696,7 +2696,7 @@ discard block |
||
2696 | 2696 | $result = \array_values( |
2697 | 2697 | \array_filter( |
2698 | 2698 | $this->toArray(false, true), |
2699 | - static function ($item) use ( |
|
2699 | + static function($item) use ( |
|
2700 | 2700 | $property, |
2701 | 2701 | $value, |
2702 | 2702 | $ops, |
@@ -2927,7 +2927,7 @@ discard block |
||
2927 | 2927 | */ |
2928 | 2928 | public function flip(): self |
2929 | 2929 | { |
2930 | - $generator = function (): \Generator { |
|
2930 | + $generator = function(): \Generator { |
|
2931 | 2931 | foreach ($this->getGenerator() as $key => $value) { |
2932 | 2932 | yield (string) $value => $key; |
2933 | 2933 | } |
@@ -3205,9 +3205,9 @@ discard block |
||
3205 | 3205 | $jsonObject = \json_decode($json, false); |
3206 | 3206 | |
3207 | 3207 | $mapper = new \Arrayy\Mapper\Json(); |
3208 | - $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($class) { |
|
3208 | + $mapper->undefinedPropertyHandler = static function($object, $key, $jsonValue) use ($class) { |
|
3209 | 3209 | if ($class->checkPropertiesMismatchInConstructor) { |
3210 | - throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object)); |
|
3210 | + throw new \TypeError('Property mismatch - input: '.\print_r(['key' => $key, 'jsonValue' => $jsonValue], true).' for object: '.\get_class($object)); |
|
3211 | 3211 | } |
3212 | 3212 | }; |
3213 | 3213 | |
@@ -3275,13 +3275,13 @@ discard block |
||
3275 | 3275 | public function getColumn($columnKey = null, $indexKey = null): self |
3276 | 3276 | { |
3277 | 3277 | if ($columnKey === null && $indexKey === null) { |
3278 | - $generator = function () { |
|
3278 | + $generator = function() { |
|
3279 | 3279 | foreach ($this->getGenerator() as $value) { |
3280 | 3280 | yield $value; |
3281 | 3281 | } |
3282 | 3282 | }; |
3283 | 3283 | } else { |
3284 | - $generator = function () use ($columnKey, $indexKey) { |
|
3284 | + $generator = function() use ($columnKey, $indexKey) { |
|
3285 | 3285 | foreach ($this->getGenerator() as $value) { |
3286 | 3286 | // reset |
3287 | 3287 | $newKey = null; |
@@ -3598,7 +3598,7 @@ discard block |
||
3598 | 3598 | |
3599 | 3599 | if ($UN_FOUND === null) { |
3600 | 3600 | // Generate unique string to use as marker. |
3601 | - $UN_FOUND = 'arrayy--' . \uniqid('arrayy', true); |
|
3601 | + $UN_FOUND = 'arrayy--'.\uniqid('arrayy', true); |
|
3602 | 3602 | } |
3603 | 3603 | |
3604 | 3604 | if (\is_array($key)) { |
@@ -3650,7 +3650,7 @@ discard block |
||
3650 | 3650 | */ |
3651 | 3651 | public function implode(string $glue = '', string $prefix = ''): string |
3652 | 3652 | { |
3653 | - return $prefix . $this->implode_recursive($glue, $this->toArray(), false); |
|
3653 | + return $prefix.$this->implode_recursive($glue, $this->toArray(), false); |
|
3654 | 3654 | } |
3655 | 3655 | |
3656 | 3656 | /** |
@@ -3764,7 +3764,7 @@ discard block |
||
3764 | 3764 | \array_uintersect( |
3765 | 3765 | $this->toArray(), |
3766 | 3766 | $search, |
3767 | - static function ($a, $b) { |
|
3767 | + static function($a, $b) { |
|
3768 | 3768 | return $a === $b ? 0 : -1; |
3769 | 3769 | } |
3770 | 3770 | ), |
@@ -4114,13 +4114,13 @@ discard block |
||
4114 | 4114 | // non recursive |
4115 | 4115 | |
4116 | 4116 | if ($search_values === null) { |
4117 | - $arrayFunction = function (): \Generator { |
|
4117 | + $arrayFunction = function(): \Generator { |
|
4118 | 4118 | foreach ($this->getGenerator() as $key => $value) { |
4119 | 4119 | yield $key; |
4120 | 4120 | } |
4121 | 4121 | }; |
4122 | 4122 | } else { |
4123 | - $arrayFunction = function () use ($search_values, $strict): \Generator { |
|
4123 | + $arrayFunction = function() use ($search_values, $strict): \Generator { |
|
4124 | 4124 | $is_array_tmp = \is_array($search_values); |
4125 | 4125 | |
4126 | 4126 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
@@ -4374,7 +4374,7 @@ discard block |
||
4374 | 4374 | $useArguments = \func_num_args() > 2; |
4375 | 4375 | |
4376 | 4376 | return static::create( |
4377 | - function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) { |
|
4377 | + function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) { |
|
4378 | 4378 | foreach ($this->getGenerator() as $key => $value) { |
4379 | 4379 | if ($useArguments) { |
4380 | 4380 | if ($useKeyAsSecondParameter) { |
@@ -4878,7 +4878,7 @@ discard block |
||
4878 | 4878 | */ |
4879 | 4879 | public function nth(int $step, int $offset = 0): self |
4880 | 4880 | { |
4881 | - $arrayFunction = function () use ($step, $offset): \Generator { |
|
4881 | + $arrayFunction = function() use ($step, $offset): \Generator { |
|
4882 | 4882 | $position = 0; |
4883 | 4883 | foreach ($this->getGenerator() as $key => $value) { |
4884 | 4884 | if ($position++ % $step !== $offset) { |
@@ -4912,7 +4912,7 @@ discard block |
||
4912 | 4912 | { |
4913 | 4913 | $keys = \array_flip($keys); |
4914 | 4914 | |
4915 | - $generator = function () use ($keys): \Generator { |
|
4915 | + $generator = function() use ($keys): \Generator { |
|
4916 | 4916 | foreach ($this->getGenerator() as $key => $value) { |
4917 | 4917 | if (isset($keys[$key])) { |
4918 | 4918 | yield $key => $value; |
@@ -5049,7 +5049,7 @@ discard block |
||
5049 | 5049 | */ |
5050 | 5050 | public function prependImmutable($value, $key = null) |
5051 | 5051 | { |
5052 | - $generator = function () use ($key, $value): \Generator { |
|
5052 | + $generator = function() use ($key, $value): \Generator { |
|
5053 | 5053 | if ($this->properties !== []) { |
5054 | 5054 | $this->checkType($key, $value); |
5055 | 5055 | } |
@@ -5099,7 +5099,7 @@ discard block |
||
5099 | 5099 | )->prependToEachKey($suffix) |
5100 | 5100 | ->toArray(); |
5101 | 5101 | } else { |
5102 | - $result[$key . $suffix] = $item; |
|
5102 | + $result[$key.$suffix] = $item; |
|
5103 | 5103 | } |
5104 | 5104 | } |
5105 | 5105 | |
@@ -5139,7 +5139,7 @@ discard block |
||
5139 | 5139 | } elseif (\is_object($item) === true) { |
5140 | 5140 | $result[$key] = $item; |
5141 | 5141 | } else { |
5142 | - $result[$key] = $item . $suffix; |
|
5142 | + $result[$key] = $item.$suffix; |
|
5143 | 5143 | } |
5144 | 5144 | } |
5145 | 5145 | |
@@ -5958,7 +5958,7 @@ discard block |
||
5958 | 5958 | */ |
5959 | 5959 | public function replaceValues($search, $replacement = ''): self |
5960 | 5960 | { |
5961 | - $callable = static function ($value) use ($search, $replacement) { |
|
5961 | + $callable = static function($value) use ($search, $replacement) { |
|
5962 | 5962 | return \str_replace($search, $replacement, $value); |
5963 | 5963 | }; |
5964 | 5964 | |
@@ -6683,7 +6683,7 @@ discard block |
||
6683 | 6683 | * @psalm-suppress MissingClosureParamType |
6684 | 6684 | */ |
6685 | 6685 | $results = $arrayy->each( |
6686 | - static function ($value) use ($sorter) { |
|
6686 | + static function($value) use ($sorter) { |
|
6687 | 6687 | if (\is_callable($sorter) === true) { |
6688 | 6688 | return $sorter($value); |
6689 | 6689 | } |
@@ -6756,7 +6756,7 @@ discard block |
||
6756 | 6756 | public function split(int $numberOfPieces = 2, bool $keepKeys = false): self |
6757 | 6757 | { |
6758 | 6758 | if ($keepKeys) { |
6759 | - $generator = function () use ($numberOfPieces) { |
|
6759 | + $generator = function() use ($numberOfPieces) { |
|
6760 | 6760 | $carry = []; |
6761 | 6761 | $i = 1; |
6762 | 6762 | foreach ($this->getGenerator() as $key => $value) { |
@@ -6779,7 +6779,7 @@ discard block |
||
6779 | 6779 | } |
6780 | 6780 | }; |
6781 | 6781 | } else { |
6782 | - $generator = function () use ($numberOfPieces) { |
|
6782 | + $generator = function() use ($numberOfPieces) { |
|
6783 | 6783 | $carry = []; |
6784 | 6784 | $i = 1; |
6785 | 6785 | foreach ($this->getGenerator() as $value) { |
@@ -6826,7 +6826,7 @@ discard block |
||
6826 | 6826 | public function stripEmpty(): self |
6827 | 6827 | { |
6828 | 6828 | return $this->filter( |
6829 | - static function ($item) { |
|
6829 | + static function($item) { |
|
6830 | 6830 | if ($item === null) { |
6831 | 6831 | return false; |
6832 | 6832 | } |
@@ -7035,7 +7035,7 @@ discard block |
||
7035 | 7035 | |
7036 | 7036 | /** @phpstan-ignore-next-line - reduce will return an array of T */ |
7037 | 7037 | $this->array = $this->reduce( |
7038 | - static function ($resultArray, $value, $key) { |
|
7038 | + static function($resultArray, $value, $key) { |
|
7039 | 7039 | if (!\in_array($value, $resultArray, true)) { |
7040 | 7040 | $resultArray[] = $value; |
7041 | 7041 | } |
@@ -7074,7 +7074,7 @@ discard block |
||
7074 | 7074 | */ |
7075 | 7075 | $this->array = \array_reduce( |
7076 | 7076 | \array_keys($array), |
7077 | - static function ($resultArray, $key) use ($array) { |
|
7077 | + static function($resultArray, $key) use ($array) { |
|
7078 | 7078 | if (!\in_array($array[$key], $resultArray, true)) { |
7079 | 7079 | $resultArray[$key] = $array[$key]; |
7080 | 7080 | } |
@@ -7171,7 +7171,7 @@ discard block |
||
7171 | 7171 | public function values(): self |
7172 | 7172 | { |
7173 | 7173 | return static::create( |
7174 | - function () { |
|
7174 | + function() { |
|
7175 | 7175 | foreach ($this->getGenerator() as $value) { |
7176 | 7176 | yield $value; |
7177 | 7177 | } |
@@ -7259,7 +7259,7 @@ discard block |
||
7259 | 7259 | public function where(string $keyOrPropertyOrMethod, $value): self |
7260 | 7260 | { |
7261 | 7261 | return $this->filter( |
7262 | - function ($item) use ($keyOrPropertyOrMethod, $value) { |
|
7262 | + function($item) use ($keyOrPropertyOrMethod, $value) { |
|
7263 | 7263 | $accessorValue = $this->extractValue( |
7264 | 7264 | $item, |
7265 | 7265 | $keyOrPropertyOrMethod |
@@ -7555,7 +7555,7 @@ discard block |
||
7555 | 7555 | protected function getPropertiesFromPhpDoc() |
7556 | 7556 | { |
7557 | 7557 | static $PROPERTY_CACHE = []; |
7558 | - $cacheKey = 'Class::' . static::class; |
|
7558 | + $cacheKey = 'Class::'.static::class; |
|
7559 | 7559 | |
7560 | 7560 | if (isset($PROPERTY_CACHE[$cacheKey])) { |
7561 | 7561 | return $PROPERTY_CACHE[$cacheKey]; |
@@ -7868,7 +7868,7 @@ discard block |
||
7868 | 7868 | if ($array === null) { |
7869 | 7869 | $array = []; |
7870 | 7870 | } elseif (!\is_array($array)) { |
7871 | - throw new \RuntimeException('Can not set value at this path "' . $key . '" because (' . \gettype($array) . ')"' . \print_r($array, true) . '" is not an array.'); |
|
7871 | + throw new \RuntimeException('Can not set value at this path "'.$key.'" because ('.\gettype($array).')"'.\print_r($array, true).'" is not an array.'); |
|
7872 | 7872 | } |
7873 | 7873 | |
7874 | 7874 | $array[$key] = $value; |
@@ -7932,7 +7932,7 @@ discard block |
||
7932 | 7932 | && |
7933 | 7933 | \count(\array_diff_key($properties, $data)) > 0 |
7934 | 7934 | ) { |
7935 | - throw new \TypeError('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($properties), true)); |
|
7935 | + throw new \TypeError('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($properties), true)); |
|
7936 | 7936 | } |
7937 | 7937 | } |
7938 | 7938 | |
@@ -8049,7 +8049,7 @@ discard block |
||
8049 | 8049 | * |
8050 | 8050 | * @return void |
8051 | 8051 | */ |
8052 | - static function (&$item) { |
|
8052 | + static function(&$item) { |
|
8053 | 8053 | if ($item instanceof self) { |
8054 | 8054 | $item = $item->getArray(); |
8055 | 8055 | } |
@@ -8074,7 +8074,7 @@ discard block |
||
8074 | 8074 | && |
8075 | 8075 | $this->checkPropertiesMismatch === true |
8076 | 8076 | ) { |
8077 | - throw new \TypeError('The key "' . $key . '" does not exists as "@property" phpdoc. (' . \get_class($this) . ').'); |
|
8077 | + throw new \TypeError('The key "'.$key.'" does not exists as "@property" phpdoc. ('.\get_class($this).').'); |
|
8078 | 8078 | } |
8079 | 8079 | |
8080 | 8080 | if (isset($this->properties[self::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES])) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if ($type instanceof \phpDocumentor\Reflection\Types\Array_) { |
118 | 118 | $valueTypeTmp = $type->getValueType()->__toString(); |
119 | 119 | if ($valueTypeTmp !== 'mixed') { |
120 | - return $valueTypeTmp . '[]'; |
|
120 | + return $valueTypeTmp.'[]'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | return 'array'; |
@@ -175,6 +175,6 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function throwException($expectedTypes, $value, $type): \Throwable |
177 | 177 | { |
178 | - throw new \TypeError("Invalid type: expected \"{$this->property_name}\" to be of type {{$expectedTypes}}, instead got value \"" . $this->valueToString($value) . '" (' . \print_r($value, true) . ") with type {{$type}}."); |
|
178 | + throw new \TypeError("Invalid type: expected \"{$this->property_name}\" to be of type {{$expectedTypes}}, instead got value \"".$this->valueToString($value).'" ('.\print_r($value, true).") with type {{$type}}."); |
|
179 | 179 | } |
180 | 180 | } |