| @@ -42,7 +42,7 @@ | ||
| 42 | 42 | } | 
| 43 | 43 | |
| 44 | 44 |          if (!isset(static::$methodArgs[$name])) { | 
| 45 | - throw new \BadMethodCallException($name . ' is not a valid method'); | |
| 45 | + throw new \BadMethodCallException($name.' is not a valid method'); | |
| 46 | 46 | } | 
| 47 | 47 | |
| 48 | 48 | $numArgs = \count($arguments); | 
| @@ -111,11 +111,11 @@ | ||
| 111 | 111 | |
| 112 | 112 | // resource | 
| 113 | 113 |          if (\is_resource($value)) { | 
| 114 | - return \get_resource_type($value) . ' resource #' . (int) $value; | |
| 114 | + return \get_resource_type($value).' resource #'.(int) $value; | |
| 115 | 115 | } | 
| 116 | 116 | |
| 117 | 117 |          if (\is_object($value)) { | 
| 118 | - return \get_class($value) . ' Object'; | |
| 118 | + return \get_class($value).' Object'; | |
| 119 | 119 | } | 
| 120 | 120 | |
| 121 | 121 | return ''; | 
| @@ -82,32 +82,32 @@ | ||
| 82 | 82 | \gettype($value) === (self::$typeMapping[$type] ?? $type) | 
| 83 | 83 | || | 
| 84 | 84 | ( | 
| 85 | - $type === 'scalar' | |
| 85 | + $type === 'scalar' | |
| 86 | 86 | && | 
| 87 | 87 | \is_scalar($value) | 
| 88 | - ) | |
| 88 | + ) | |
| 89 | 89 | || | 
| 90 | 90 | ( | 
| 91 | - $type === 'callable' | |
| 91 | + $type === 'callable' | |
| 92 | 92 | && | 
| 93 | 93 | \is_callable($value) | 
| 94 | - ) | |
| 94 | + ) | |
| 95 | 95 | || | 
| 96 | 96 | ( | 
| 97 | - $type === 'numeric' | |
| 97 | + $type === 'numeric' | |
| 98 | 98 | && | 
| 99 | 99 | ( | 
| 100 | - \is_float($value) | |
| 100 | + \is_float($value) | |
| 101 | 101 | || | 
| 102 | 102 | \is_int($value) | 
| 103 | - ) | |
| 104 | - ) | |
| 103 | + ) | |
| 104 | + ) | |
| 105 | 105 | || | 
| 106 | 106 | ( | 
| 107 | - $type === 'resource' | |
| 107 | + $type === 'resource' | |
| 108 | 108 | && | 
| 109 | 109 | \is_resource($value) | 
| 110 | - ); | |
| 110 | + ); | |
| 111 | 111 | } | 
| 112 | 112 | |
| 113 | 113 | /** | 
| @@ -26,7 +26,7 @@ | ||
| 26 | 26 | */ | 
| 27 | 27 | public function throwException($expectedTypes, $value, $type): \Throwable | 
| 28 | 28 |      { | 
| 29 | -        throw new \TypeError("Invalid type: expected to be of type {{$expectedTypes}}, instead got value `" . \print_r($value, true) . "` with type {{$type}}."); | |
| 29 | +        throw new \TypeError("Invalid type: expected to be of type {{$expectedTypes}}, instead got value `".\print_r($value, true)."` with type {{$type}}."); | |
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | 32 | /** | 
| @@ -290,9 +290,9 @@ | ||
| 290 | 290 | $return = static::create(); | 
| 291 | 291 | $jsonObject = \json_decode($json, false); | 
| 292 | 292 | $mapper = new \Arrayy\Mapper\Json(); | 
| 293 | -        $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($return) { | |
| 293 | +        $mapper->undefinedPropertyHandler = static function($object, $key, $jsonValue) use ($return) { | |
| 294 | 294 |              if ($return->checkForMissingPropertiesInConstructor) { | 
| 295 | -                throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object)); | |
| 295 | +                throw new \TypeError('Property mismatch - input: '.\print_r(['key' => $key, 'jsonValue' => $jsonValue], true).' for object: '.\get_class($object)); | |
| 296 | 296 | } | 
| 297 | 297 | }; | 
| 298 | 298 | |
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -require __DIR__ . '/../vendor/autoload.php'; | |
| 4 | -require __DIR__ . '/vendor/autoload.php'; | |
| 3 | +require __DIR__.'/../vendor/autoload.php'; | |
| 4 | +require __DIR__.'/vendor/autoload.php'; | |
| 5 | 5 | |
| 6 | 6 | $readmeText = (new \voku\PhpReadmeHelper\GenerateApi())->generate( | 
| 7 | - __DIR__ . '/../src/Arrayy.php', | |
| 8 | - __DIR__ . '/docs/base.md' | |
| 7 | + __DIR__.'/../src/Arrayy.php', | |
| 8 | + __DIR__.'/docs/base.md' | |
| 9 | 9 | ); | 
| 10 | 10 | |
| 11 | -file_put_contents(__DIR__ . '/../README.md', $readmeText); | |
| 11 | +file_put_contents(__DIR__.'/../README.md', $readmeText); | |
| @@ -1542,11 +1542,11 @@ | ||
| 1542 | 1542 | ), | 
| 1543 | 1543 | \COUNT_NORMAL | 
| 1544 | 1544 | ) | 
| 1545 | - === | |
| 1546 | - \count( | |
| 1547 | - $needles, | |
| 1548 | - \COUNT_NORMAL | |
| 1549 | - ); | |
| 1545 | + === | |
| 1546 | + \count( | |
| 1547 | + $needles, | |
| 1548 | + \COUNT_NORMAL | |
| 1549 | + ); | |
| 1550 | 1550 | } | 
| 1551 | 1551 | |
| 1552 | 1552 | /** | 
| @@ -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, | 
| @@ -2926,7 +2926,7 @@ discard block | ||
| 2926 | 2926 | */ | 
| 2927 | 2927 | public function flip(): self | 
| 2928 | 2928 |      { | 
| 2929 | -        $generator = function (): \Generator { | |
| 2929 | +        $generator = function(): \Generator { | |
| 2930 | 2930 |              foreach ($this->getGenerator() as $key => $value) { | 
| 2931 | 2931 | yield (string) $value => $key; | 
| 2932 | 2932 | } | 
| @@ -3204,9 +3204,9 @@ discard block | ||
| 3204 | 3204 | $jsonObject = \json_decode($json, false); | 
| 3205 | 3205 | |
| 3206 | 3206 | $mapper = new \Arrayy\Mapper\Json(); | 
| 3207 | -        $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($class) { | |
| 3207 | +        $mapper->undefinedPropertyHandler = static function($object, $key, $jsonValue) use ($class) { | |
| 3208 | 3208 |              if ($class->checkPropertiesMismatchInConstructor) { | 
| 3209 | -                throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object)); | |
| 3209 | +                throw new \TypeError('Property mismatch - input: '.\print_r(['key' => $key, 'jsonValue' => $jsonValue], true).' for object: '.\get_class($object)); | |
| 3210 | 3210 | } | 
| 3211 | 3211 | }; | 
| 3212 | 3212 | |
| @@ -3274,13 +3274,13 @@ discard block | ||
| 3274 | 3274 | public function getColumn($columnKey = null, $indexKey = null): self | 
| 3275 | 3275 |      { | 
| 3276 | 3276 |          if ($columnKey === null && $indexKey === null) { | 
| 3277 | -            $generator = function () { | |
| 3277 | +            $generator = function() { | |
| 3278 | 3278 |                  foreach ($this->getGenerator() as $value) { | 
| 3279 | 3279 | yield $value; | 
| 3280 | 3280 | } | 
| 3281 | 3281 | }; | 
| 3282 | 3282 |          } else { | 
| 3283 | -            $generator = function () use ($columnKey, $indexKey) { | |
| 3283 | +            $generator = function() use ($columnKey, $indexKey) { | |
| 3284 | 3284 |                  foreach ($this->getGenerator() as $value) { | 
| 3285 | 3285 | // reset | 
| 3286 | 3286 | $newKey = null; | 
| @@ -3597,7 +3597,7 @@ discard block | ||
| 3597 | 3597 | |
| 3598 | 3598 |          if ($UN_FOUND === null) { | 
| 3599 | 3599 | // Generate unique string to use as marker. | 
| 3600 | -            $UN_FOUND = 'arrayy--' . \uniqid('arrayy', true); | |
| 3600 | +            $UN_FOUND = 'arrayy--'.\uniqid('arrayy', true); | |
| 3601 | 3601 | } | 
| 3602 | 3602 | |
| 3603 | 3603 |          if (\is_array($key)) { | 
| @@ -3649,7 +3649,7 @@ discard block | ||
| 3649 | 3649 | */ | 
| 3650 | 3650 | public function implode(string $glue = '', string $prefix = ''): string | 
| 3651 | 3651 |      { | 
| 3652 | - return $prefix . $this->implode_recursive($glue, $this->toArray(), false); | |
| 3652 | + return $prefix.$this->implode_recursive($glue, $this->toArray(), false); | |
| 3653 | 3653 | } | 
| 3654 | 3654 | |
| 3655 | 3655 | /** | 
| @@ -3763,7 +3763,7 @@ discard block | ||
| 3763 | 3763 | \array_uintersect( | 
| 3764 | 3764 | $this->toArray(), | 
| 3765 | 3765 | $search, | 
| 3766 | -                    static function ($a, $b) { | |
| 3766 | +                    static function($a, $b) { | |
| 3767 | 3767 | return $a === $b ? 0 : -1; | 
| 3768 | 3768 | } | 
| 3769 | 3769 | ), | 
| @@ -4113,13 +4113,13 @@ discard block | ||
| 4113 | 4113 | // non recursive | 
| 4114 | 4114 | |
| 4115 | 4115 |          if ($search_values === null) { | 
| 4116 | -            $arrayFunction = function (): \Generator { | |
| 4116 | +            $arrayFunction = function(): \Generator { | |
| 4117 | 4117 |                  foreach ($this->getGenerator() as $key => $value) { | 
| 4118 | 4118 | yield $key; | 
| 4119 | 4119 | } | 
| 4120 | 4120 | }; | 
| 4121 | 4121 |          } else { | 
| 4122 | -            $arrayFunction = function () use ($search_values, $strict): \Generator { | |
| 4122 | +            $arrayFunction = function() use ($search_values, $strict): \Generator { | |
| 4123 | 4123 | $is_array_tmp = \is_array($search_values); | 
| 4124 | 4124 | |
| 4125 | 4125 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ | 
| @@ -4373,7 +4373,7 @@ discard block | ||
| 4373 | 4373 | $useArguments = \func_num_args() > 2; | 
| 4374 | 4374 | |
| 4375 | 4375 | return static::create( | 
| 4376 | -            function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) { | |
| 4376 | +            function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) { | |
| 4377 | 4377 |                  foreach ($this->getGenerator() as $key => $value) { | 
| 4378 | 4378 |                      if ($useArguments) { | 
| 4379 | 4379 |                          if ($useKeyAsSecondParameter) { | 
| @@ -4877,7 +4877,7 @@ discard block | ||
| 4877 | 4877 | */ | 
| 4878 | 4878 | public function nth(int $step, int $offset = 0): self | 
| 4879 | 4879 |      { | 
| 4880 | -        $arrayFunction = function () use ($step, $offset): \Generator { | |
| 4880 | +        $arrayFunction = function() use ($step, $offset): \Generator { | |
| 4881 | 4881 | $position = 0; | 
| 4882 | 4882 |              foreach ($this->getGenerator() as $key => $value) { | 
| 4883 | 4883 |                  if ($position++ % $step !== $offset) { | 
| @@ -4911,7 +4911,7 @@ discard block | ||
| 4911 | 4911 |      { | 
| 4912 | 4912 | $keys = \array_flip($keys); | 
| 4913 | 4913 | |
| 4914 | -        $generator = function () use ($keys): \Generator { | |
| 4914 | +        $generator = function() use ($keys): \Generator { | |
| 4915 | 4915 |              foreach ($this->getGenerator() as $key => $value) { | 
| 4916 | 4916 |                  if (isset($keys[$key])) { | 
| 4917 | 4917 | yield $key => $value; | 
| @@ -5048,7 +5048,7 @@ discard block | ||
| 5048 | 5048 | */ | 
| 5049 | 5049 | public function prependImmutable($value, $key = null) | 
| 5050 | 5050 |      { | 
| 5051 | -        $generator = function () use ($key, $value): \Generator { | |
| 5051 | +        $generator = function() use ($key, $value): \Generator { | |
| 5052 | 5052 |              if ($this->properties !== []) { | 
| 5053 | 5053 | $this->checkType($key, $value); | 
| 5054 | 5054 | } | 
| @@ -5098,7 +5098,7 @@ discard block | ||
| 5098 | 5098 | )->prependToEachKey($suffix) | 
| 5099 | 5099 | ->toArray(); | 
| 5100 | 5100 |              } else { | 
| 5101 | - $result[$key . $suffix] = $item; | |
| 5101 | + $result[$key.$suffix] = $item; | |
| 5102 | 5102 | } | 
| 5103 | 5103 | } | 
| 5104 | 5104 | |
| @@ -5138,7 +5138,7 @@ discard block | ||
| 5138 | 5138 |              } elseif (\is_object($item) === true) { | 
| 5139 | 5139 | $result[$key] = $item; | 
| 5140 | 5140 |              } else { | 
| 5141 | - $result[$key] = $item . $suffix; | |
| 5141 | + $result[$key] = $item.$suffix; | |
| 5142 | 5142 | } | 
| 5143 | 5143 | } | 
| 5144 | 5144 | |
| @@ -5960,7 +5960,7 @@ discard block | ||
| 5960 | 5960 | */ | 
| 5961 | 5961 | public function replaceValues($search, $replacement = ''): self | 
| 5962 | 5962 |      { | 
| 5963 | -        $callable = static function ($value) use ($search, $replacement) { | |
| 5963 | +        $callable = static function($value) use ($search, $replacement) { | |
| 5964 | 5964 | return \str_replace($search, $replacement, $value); | 
| 5965 | 5965 | }; | 
| 5966 | 5966 | |
| @@ -6685,7 +6685,7 @@ discard block | ||
| 6685 | 6685 | * @psalm-suppress MissingClosureParamType | 
| 6686 | 6686 | */ | 
| 6687 | 6687 | $results = $arrayy->each( | 
| 6688 | -                static function ($value) use ($sorter) { | |
| 6688 | +                static function($value) use ($sorter) { | |
| 6689 | 6689 |                      if (\is_callable($sorter) === true) { | 
| 6690 | 6690 | return $sorter($value); | 
| 6691 | 6691 | } | 
| @@ -6758,7 +6758,7 @@ discard block | ||
| 6758 | 6758 | public function split(int $numberOfPieces = 2, bool $keepKeys = false): self | 
| 6759 | 6759 |      { | 
| 6760 | 6760 |          if ($keepKeys) { | 
| 6761 | -            $generator = function () use ($numberOfPieces) { | |
| 6761 | +            $generator = function() use ($numberOfPieces) { | |
| 6762 | 6762 | $carry = []; | 
| 6763 | 6763 | $i = 1; | 
| 6764 | 6764 |                  foreach ($this->getGenerator() as $key => $value) { | 
| @@ -6781,7 +6781,7 @@ discard block | ||
| 6781 | 6781 | } | 
| 6782 | 6782 | }; | 
| 6783 | 6783 |          } else { | 
| 6784 | -            $generator = function () use ($numberOfPieces) { | |
| 6784 | +            $generator = function() use ($numberOfPieces) { | |
| 6785 | 6785 | $carry = []; | 
| 6786 | 6786 | $i = 1; | 
| 6787 | 6787 |                  foreach ($this->getGenerator() as $value) { | 
| @@ -6828,7 +6828,7 @@ discard block | ||
| 6828 | 6828 | public function stripEmpty(): self | 
| 6829 | 6829 |      { | 
| 6830 | 6830 | return $this->filter( | 
| 6831 | -            static function ($item) { | |
| 6831 | +            static function($item) { | |
| 6832 | 6832 |                  if ($item === null) { | 
| 6833 | 6833 | return false; | 
| 6834 | 6834 | } | 
| @@ -7037,7 +7037,7 @@ discard block | ||
| 7037 | 7037 | |
| 7038 | 7038 | /* @phpstan-ignore-next-line - reduce will return an array of T */ | 
| 7039 | 7039 | $this->array = $this->reduce( | 
| 7040 | -            static function ($resultArray, $value, $key) { | |
| 7040 | +            static function($resultArray, $value, $key) { | |
| 7041 | 7041 |                  if (!\in_array($value, $resultArray, true)) { | 
| 7042 | 7042 | $resultArray[] = $value; | 
| 7043 | 7043 | } | 
| @@ -7076,7 +7076,7 @@ discard block | ||
| 7076 | 7076 | */ | 
| 7077 | 7077 | $this->array = \array_reduce( | 
| 7078 | 7078 | \array_keys($array), | 
| 7079 | -            static function ($resultArray, $key) use ($array) { | |
| 7079 | +            static function($resultArray, $key) use ($array) { | |
| 7080 | 7080 |                  if (!\in_array($array[$key], $resultArray, true)) { | 
| 7081 | 7081 | $resultArray[$key] = $array[$key]; | 
| 7082 | 7082 | } | 
| @@ -7173,7 +7173,7 @@ discard block | ||
| 7173 | 7173 | public function values(): self | 
| 7174 | 7174 |      { | 
| 7175 | 7175 | return static::create( | 
| 7176 | -            function () { | |
| 7176 | +            function() { | |
| 7177 | 7177 |                  foreach ($this->getGenerator() as $value) { | 
| 7178 | 7178 | yield $value; | 
| 7179 | 7179 | } | 
| @@ -7257,7 +7257,7 @@ discard block | ||
| 7257 | 7257 | public function where(string $keyOrPropertyOrMethod, $value): self | 
| 7258 | 7258 |      { | 
| 7259 | 7259 | return $this->filter( | 
| 7260 | -            function ($item) use ($keyOrPropertyOrMethod, $value) { | |
| 7260 | +            function($item) use ($keyOrPropertyOrMethod, $value) { | |
| 7261 | 7261 | $accessorValue = $this->extractValue( | 
| 7262 | 7262 | $item, | 
| 7263 | 7263 | $keyOrPropertyOrMethod | 
| @@ -7553,7 +7553,7 @@ discard block | ||
| 7553 | 7553 | protected function getPropertiesFromPhpDoc() | 
| 7554 | 7554 |      { | 
| 7555 | 7555 | static $PROPERTY_CACHE = []; | 
| 7556 | - $cacheKey = 'Class::' . static::class; | |
| 7556 | + $cacheKey = 'Class::'.static::class; | |
| 7557 | 7557 | |
| 7558 | 7558 |          if (isset($PROPERTY_CACHE[$cacheKey])) { | 
| 7559 | 7559 | return $PROPERTY_CACHE[$cacheKey]; | 
| @@ -7866,7 +7866,7 @@ discard block | ||
| 7866 | 7866 |          if ($array === null) { | 
| 7867 | 7867 | $array = []; | 
| 7868 | 7868 |          } elseif (!\is_array($array)) { | 
| 7869 | -            throw new \RuntimeException('Can not set value at this path "' . $key . '" because (' . \gettype($array) . ')"' . \print_r($array, true) . '" is not an array.'); | |
| 7869 | +            throw new \RuntimeException('Can not set value at this path "'.$key.'" because ('.\gettype($array).')"'.\print_r($array, true).'" is not an array.'); | |
| 7870 | 7870 | } | 
| 7871 | 7871 | |
| 7872 | 7872 | $array[$key] = $value; | 
| @@ -7930,7 +7930,7 @@ discard block | ||
| 7930 | 7930 | && | 
| 7931 | 7931 | \count(\array_diff_key($properties, $data)) > 0 | 
| 7932 | 7932 |              ) { | 
| 7933 | -                throw new \TypeError('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($properties), true)); | |
| 7933 | +                throw new \TypeError('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($properties), true)); | |
| 7934 | 7934 | } | 
| 7935 | 7935 | } | 
| 7936 | 7936 | |
| @@ -8047,7 +8047,7 @@ discard block | ||
| 8047 | 8047 | * | 
| 8048 | 8048 | * @return void | 
| 8049 | 8049 | */ | 
| 8050 | -            static function (&$item) { | |
| 8050 | +            static function(&$item) { | |
| 8051 | 8051 |                  if ($item instanceof self) { | 
| 8052 | 8052 | $item = $item->getArray(); | 
| 8053 | 8053 | } | 
| @@ -8072,7 +8072,7 @@ discard block | ||
| 8072 | 8072 | && | 
| 8073 | 8073 | $this->checkPropertiesMismatch === true | 
| 8074 | 8074 |          ) { | 
| 8075 | -            throw new \TypeError('The key "' . $key . '" does not exists as "@property" phpdoc. (' . \get_class($this) . ').'); | |
| 8075 | +            throw new \TypeError('The key "'.$key.'" does not exists as "@property" phpdoc. ('.\get_class($this).').'); | |
| 8076 | 8076 | } | 
| 8077 | 8077 | |
| 8078 | 8078 |          if (isset($this->properties[self::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES])) { | 
| @@ -2,7 +2,7 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Arrayy\tests; | 
| 4 | 4 | |
| 5 | -require_once __DIR__ . '/../vendor/autoload.php'; | |
| 5 | +require_once __DIR__.'/../vendor/autoload.php'; | |
| 6 | 6 | |
| 7 | 7 | /** | 
| 8 | 8 | * @property string $type | 
| @@ -72,7 +72,7 @@ discard block | ||
| 72 | 72 | |
| 73 | 73 |          if (!\is_object($object)) { | 
| 74 | 74 | throw new \InvalidArgumentException( | 
| 75 | - 'JsonMapper::map() requires second argument to be an object, ' . \gettype($object) . ' given.' | |
| 75 | + 'JsonMapper::map() requires second argument to be an object, '.\gettype($object).' given.' | |
| 76 | 76 | ); | 
| 77 | 77 | } | 
| 78 | 78 | |
| @@ -121,7 +121,7 @@ discard block | ||
| 121 | 121 | $type = $this->removeNullable($type); | 
| 122 | 122 |              } elseif ($jsonValue === null) { | 
| 123 | 123 | throw new \InvalidArgumentException( | 
| 124 | - 'JSON property "' . $key . '" in class "' . $strClassName . '" must not be NULL' | |
| 124 | + 'JSON property "'.$key.'" in class "'.$strClassName.'" must not be NULL' | |
| 125 | 125 | ); | 
| 126 | 126 | } | 
| 127 | 127 | |
| @@ -148,7 +148,7 @@ discard block | ||
| 148 | 148 |              if ($this->isSimpleType($type)) { | 
| 149 | 149 |                  if ($type === 'string' && \is_object($jsonValue)) { | 
| 150 | 150 | throw new \InvalidArgumentException( | 
| 151 | - 'JSON property "' . $key . '" in class "' . $strClassName . '" is an object and cannot be converted to a string' | |
| 151 | + 'JSON property "'.$key.'" in class "'.$strClassName.'" is an object and cannot be converted to a string' | |
| 152 | 152 | ); | 
| 153 | 153 | } | 
| 154 | 154 | |
| @@ -169,7 +169,7 @@ discard block | ||
| 169 | 169 | |
| 170 | 170 |              if ($type === '') { | 
| 171 | 171 | throw new \InvalidArgumentException( | 
| 172 | - 'Empty type at property "' . $strClassName . '::$' . $key . '"' | |
| 172 | + 'Empty type at property "'.$strClassName.'::$'.$key.'"' | |
| 173 | 173 | ); | 
| 174 | 174 | } | 
| 175 | 175 | |
| @@ -203,7 +203,7 @@ discard block | ||
| 203 | 203 | $this->isScalarType(\gettype($jsonValue)) | 
| 204 | 204 |                  ) { | 
| 205 | 205 | throw new \InvalidArgumentException( | 
| 206 | - 'JSON property "' . $key . '" must be an array, ' . \gettype($jsonValue) . ' given' | |
| 206 | + 'JSON property "'.$key.'" must be an array, '.\gettype($jsonValue).' given' | |
| 207 | 207 | ); | 
| 208 | 208 | } | 
| 209 | 209 | |
| @@ -303,7 +303,7 @@ discard block | ||
| 303 | 303 | } | 
| 304 | 304 |              } elseif ($this->isScalarType($class)) { | 
| 305 | 305 | throw new \InvalidArgumentException( | 
| 306 | - 'JSON property "' . ($parent_key ?: '?') . '" is an array of type "' . $class . '" but contained a value of type "' . \gettype($jsonValue) . '"' | |
| 306 | + 'JSON property "'.($parent_key ?: '?').'" is an array of type "'.$class.'" but contained a value of type "'.\gettype($jsonValue).'"' | |
| 307 | 307 | ); | 
| 308 | 308 |              } elseif (\is_a($class, \ArrayObject::class, true)) { | 
| 309 | 309 | /** @noinspection PhpSillyAssignmentInspection - phpstan helper */ | 
| @@ -359,7 +359,7 @@ discard block | ||
| 359 | 359 | } | 
| 360 | 360 | |
| 361 | 361 | //create a full qualified namespace | 
| 362 | - return '\\' . $strNs . '\\' . $type; | |
| 362 | + return '\\'.$strNs.'\\'.$type; | |
| 363 | 363 | } | 
| 364 | 364 | |
| 365 | 365 | /** | 
| @@ -663,7 +663,7 @@ discard block | ||
| 663 | 663 | */ | 
| 664 | 664 | private function isNullable($type): bool | 
| 665 | 665 |      { | 
| 666 | -        return \stripos('|' . $type . '|', '|null|') !== false; | |
| 666 | +        return \stripos('|'.$type.'|', '|null|') !== false; | |
| 667 | 667 | } | 
| 668 | 668 | |
| 669 | 669 | /** | 
| @@ -680,7 +680,7 @@ discard block | ||
| 680 | 680 | } | 
| 681 | 681 | |
| 682 | 682 | return \substr( | 
| 683 | -            \str_ireplace('|null|', '|', '|' . $type . '|'), | |
| 683 | +            \str_ireplace('|null|', '|', '|'.$type.'|'), | |
| 684 | 684 | 1, | 
| 685 | 685 | -1 | 
| 686 | 686 | ); | 
| @@ -728,7 +728,7 @@ discard block | ||
| 728 | 728 | $constructor->getNumberOfRequiredParameters() > 0 | 
| 729 | 729 |          ) { | 
| 730 | 730 | /** @phpstan-var TClass $return */ | 
| 731 | - $return = $reflectClass->newInstanceWithoutConstructor(); | |
| 731 | + $return = $reflectClass->newInstanceWithoutConstructor(); | |
| 732 | 732 |          } else { | 
| 733 | 733 | /** @phpstan-var TClass $return */ | 
| 734 | 734 | $return = $reflectClass->newInstance(); | 
| @@ -67,6 +67,6 @@ | ||
| 67 | 67 | */ | 
| 68 | 68 | public function throwException($expectedTypes, $value, $type): \Throwable | 
| 69 | 69 |      { | 
| 70 | -        throw new \TypeError('Invalid type: callable failed, got value `' . \print_r($value, true) . "` with type {{$type}}."); | |
| 70 | +        throw new \TypeError('Invalid type: callable failed, got value `'.\print_r($value, true)."` with type {{$type}}."); | |
| 71 | 71 | } | 
| 72 | 72 | } |