Completed
Push — master ( 4635ac...732790 )
by Lars
17:01
created
src/StaticArrayy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/TypeCheck/AbstractTypeCheck.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,11 +111,11 @@
 block discarded – undo
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 '';
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -82,32 +82,32 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/TypeCheck/TypeCheckSimple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
build/generate_docs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Arrayy.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1542,11 +1542,11 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
@@ -3203,9 +3203,9 @@  discard block
 block discarded – undo
3203 3203
         $jsonObject = \json_decode($json, false);
3204 3204
 
3205 3205
         $mapper = new \Arrayy\Mapper\Json();
3206
-        $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($class) {
3206
+        $mapper->undefinedPropertyHandler = static function($object, $key, $jsonValue) use ($class) {
3207 3207
             if ($class->checkPropertiesMismatchInConstructor) {
3208
-                throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object));
3208
+                throw new \TypeError('Property mismatch - input: '.\print_r(['key' => $key, 'jsonValue' => $jsonValue], true).' for object: '.\get_class($object));
3209 3209
             }
3210 3210
         };
3211 3211
 
@@ -3273,13 +3273,13 @@  discard block
 block discarded – undo
3273 3273
     public function getColumn($columnKey = null, $indexKey = null): self
3274 3274
     {
3275 3275
         if ($columnKey === null && $indexKey === null) {
3276
-            $generator = function () {
3276
+            $generator = function() {
3277 3277
                 foreach ($this->getGenerator() as $value) {
3278 3278
                     yield $value;
3279 3279
                 }
3280 3280
             };
3281 3281
         } else {
3282
-            $generator = function () use ($columnKey, $indexKey) {
3282
+            $generator = function() use ($columnKey, $indexKey) {
3283 3283
                 foreach ($this->getGenerator() as $value) {
3284 3284
                     // reset
3285 3285
                     $newKey = null;
@@ -3596,7 +3596,7 @@  discard block
 block discarded – undo
3596 3596
 
3597 3597
         if ($UN_FOUND === null) {
3598 3598
             // Generate unique string to use as marker.
3599
-            $UN_FOUND = 'arrayy--' . \uniqid('arrayy', true);
3599
+            $UN_FOUND = 'arrayy--'.\uniqid('arrayy', true);
3600 3600
         }
3601 3601
 
3602 3602
         if (\is_array($key)) {
@@ -3648,7 +3648,7 @@  discard block
 block discarded – undo
3648 3648
      */
3649 3649
     public function implode(string $glue = '', string $prefix = ''): string
3650 3650
     {
3651
-        return $prefix . $this->implode_recursive($glue, $this->toArray(), false);
3651
+        return $prefix.$this->implode_recursive($glue, $this->toArray(), false);
3652 3652
     }
3653 3653
 
3654 3654
     /**
@@ -3762,7 +3762,7 @@  discard block
 block discarded – undo
3762 3762
                 \array_uintersect(
3763 3763
                     $this->toArray(),
3764 3764
                     $search,
3765
-                    static function ($a, $b) {
3765
+                    static function($a, $b) {
3766 3766
                         return $a === $b ? 0 : -1;
3767 3767
                     }
3768 3768
                 ),
@@ -4112,13 +4112,13 @@  discard block
 block discarded – undo
4112 4112
         // non recursive
4113 4113
 
4114 4114
         if ($search_values === null) {
4115
-            $arrayFunction = function (): \Generator {
4115
+            $arrayFunction = function(): \Generator {
4116 4116
                 foreach ($this->getGenerator() as $key => $value) {
4117 4117
                     yield $key;
4118 4118
                 }
4119 4119
             };
4120 4120
         } else {
4121
-            $arrayFunction = function () use ($search_values, $strict): \Generator {
4121
+            $arrayFunction = function() use ($search_values, $strict): \Generator {
4122 4122
                 $is_array_tmp = \is_array($search_values);
4123 4123
 
4124 4124
                 /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */
@@ -4372,7 +4372,7 @@  discard block
 block discarded – undo
4372 4372
         $useArguments = \func_num_args() > 2;
4373 4373
 
4374 4374
         return static::create(
4375
-            function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
4375
+            function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
4376 4376
                 foreach ($this->getGenerator() as $key => $value) {
4377 4377
                     if ($useArguments) {
4378 4378
                         if ($useKeyAsSecondParameter) {
@@ -4876,7 +4876,7 @@  discard block
 block discarded – undo
4876 4876
      */
4877 4877
     public function nth(int $step, int $offset = 0): self
4878 4878
     {
4879
-        $arrayFunction = function () use ($step, $offset): \Generator {
4879
+        $arrayFunction = function() use ($step, $offset): \Generator {
4880 4880
             $position = 0;
4881 4881
             foreach ($this->getGenerator() as $key => $value) {
4882 4882
                 if ($position++ % $step !== $offset) {
@@ -4910,7 +4910,7 @@  discard block
 block discarded – undo
4910 4910
     {
4911 4911
         $keys = \array_flip($keys);
4912 4912
 
4913
-        $generator = function () use ($keys): \Generator {
4913
+        $generator = function() use ($keys): \Generator {
4914 4914
             foreach ($this->getGenerator() as $key => $value) {
4915 4915
                 if (isset($keys[$key])) {
4916 4916
                     yield $key => $value;
@@ -5047,7 +5047,7 @@  discard block
 block discarded – undo
5047 5047
      */
5048 5048
     public function prependImmutable($value, $key = null)
5049 5049
     {
5050
-        $generator = function () use ($key, $value): \Generator {
5050
+        $generator = function() use ($key, $value): \Generator {
5051 5051
             if ($this->properties !== []) {
5052 5052
                 $this->checkType($key, $value);
5053 5053
             }
@@ -5097,7 +5097,7 @@  discard block
 block discarded – undo
5097 5097
                 )->prependToEachKey($suffix)
5098 5098
                     ->toArray();
5099 5099
             } else {
5100
-                $result[$key . $suffix] = $item;
5100
+                $result[$key.$suffix] = $item;
5101 5101
             }
5102 5102
         }
5103 5103
 
@@ -5137,7 +5137,7 @@  discard block
 block discarded – undo
5137 5137
             } elseif (\is_object($item) === true) {
5138 5138
                 $result[$key] = $item;
5139 5139
             } else {
5140
-                $result[$key] = $item . $suffix;
5140
+                $result[$key] = $item.$suffix;
5141 5141
             }
5142 5142
         }
5143 5143
 
@@ -5959,7 +5959,7 @@  discard block
 block discarded – undo
5959 5959
      */
5960 5960
     public function replaceValues($search, $replacement = ''): self
5961 5961
     {
5962
-        $callable = static function ($value) use ($search, $replacement) {
5962
+        $callable = static function($value) use ($search, $replacement) {
5963 5963
             return \str_replace($search, $replacement, $value);
5964 5964
         };
5965 5965
 
@@ -6684,7 +6684,7 @@  discard block
 block discarded – undo
6684 6684
              * @psalm-suppress MissingClosureParamType
6685 6685
              */
6686 6686
             $results = $arrayy->each(
6687
-                static function ($value) use ($sorter) {
6687
+                static function($value) use ($sorter) {
6688 6688
                     if (\is_callable($sorter) === true) {
6689 6689
                         return $sorter($value);
6690 6690
                     }
@@ -6757,7 +6757,7 @@  discard block
 block discarded – undo
6757 6757
     public function split(int $numberOfPieces = 2, bool $keepKeys = false): self
6758 6758
     {
6759 6759
         if ($keepKeys) {
6760
-            $generator = function () use ($numberOfPieces) {
6760
+            $generator = function() use ($numberOfPieces) {
6761 6761
                 $carry = [];
6762 6762
                 $i = 1;
6763 6763
                 foreach ($this->getGenerator() as $key => $value) {
@@ -6780,7 +6780,7 @@  discard block
 block discarded – undo
6780 6780
                 }
6781 6781
             };
6782 6782
         } else {
6783
-            $generator = function () use ($numberOfPieces) {
6783
+            $generator = function() use ($numberOfPieces) {
6784 6784
                 $carry = [];
6785 6785
                 $i = 1;
6786 6786
                 foreach ($this->getGenerator() as $value) {
@@ -6827,7 +6827,7 @@  discard block
 block discarded – undo
6827 6827
     public function stripEmpty(): self
6828 6828
     {
6829 6829
         return $this->filter(
6830
-            static function ($item) {
6830
+            static function($item) {
6831 6831
                 if ($item === null) {
6832 6832
                     return false;
6833 6833
                 }
@@ -7035,7 +7035,7 @@  discard block
 block discarded – undo
7035 7035
         // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array
7036 7036
 
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
 block discarded – undo
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
 block discarded – undo
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
                 }
@@ -7255,7 +7255,7 @@  discard block
 block discarded – undo
7255 7255
     public function where(string $keyOrPropertyOrMethod, $value): self
7256 7256
     {
7257 7257
         return $this->filter(
7258
-            function ($item) use ($keyOrPropertyOrMethod, $value) {
7258
+            function($item) use ($keyOrPropertyOrMethod, $value) {
7259 7259
                 $accessorValue = $this->extractValue(
7260 7260
                     $item,
7261 7261
                     $keyOrPropertyOrMethod
@@ -7551,7 +7551,7 @@  discard block
 block discarded – undo
7551 7551
     protected function getPropertiesFromPhpDoc()
7552 7552
     {
7553 7553
         static $PROPERTY_CACHE = [];
7554
-        $cacheKey = 'Class::' . static::class;
7554
+        $cacheKey = 'Class::'.static::class;
7555 7555
 
7556 7556
         if (isset($PROPERTY_CACHE[$cacheKey])) {
7557 7557
             return $PROPERTY_CACHE[$cacheKey];
@@ -7864,7 +7864,7 @@  discard block
 block discarded – undo
7864 7864
         if ($array === null) {
7865 7865
             $array = [];
7866 7866
         } elseif (!\is_array($array)) {
7867
-            throw new \RuntimeException('Can not set value at this path "' . $key . '" because (' . \gettype($array) . ')"' . \print_r($array, true) . '" is not an array.');
7867
+            throw new \RuntimeException('Can not set value at this path "'.$key.'" because ('.\gettype($array).')"'.\print_r($array, true).'" is not an array.');
7868 7868
         }
7869 7869
 
7870 7870
         $array[$key] = $value;
@@ -7928,7 +7928,7 @@  discard block
 block discarded – undo
7928 7928
                 &&
7929 7929
                 \count(\array_diff_key($properties, $data)) > 0
7930 7930
             ) {
7931
-                throw new \TypeError('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($properties), true));
7931
+                throw new \TypeError('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($properties), true));
7932 7932
             }
7933 7933
         }
7934 7934
 
@@ -8045,7 +8045,7 @@  discard block
 block discarded – undo
8045 8045
              *
8046 8046
              * @return void
8047 8047
              */
8048
-            static function (&$item) {
8048
+            static function(&$item) {
8049 8049
                 if ($item instanceof self) {
8050 8050
                     $item = $item->getArray();
8051 8051
                 }
@@ -8070,7 +8070,7 @@  discard block
 block discarded – undo
8070 8070
             &&
8071 8071
             $this->checkPropertiesMismatch === true
8072 8072
         ) {
8073
-            throw new \TypeError('The key "' . $key . '" does not exists as "@property" phpdoc. (' . \get_class($this) . ').');
8073
+            throw new \TypeError('The key "'.$key.'" does not exists as "@property" phpdoc. ('.\get_class($this).').');
8074 8074
         }
8075 8075
 
8076 8076
         if (isset($this->properties[self::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES])) {
Please login to merge, or discard this patch.
examples/JsonResponseDataExample.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Mapper/Json.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/TypeCheck/TypeCheckCallback.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,6 +67,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Type/NumericStringCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $return = TypeCheckArray::create(
25 25
             [
26 26
                 Arrayy::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES => new TypeCheckCallback(
27
-                    static function ($value) {
27
+                    static function($value) {
28 28
                         return \is_string($value) && \is_numeric($value);
29 29
                     }
30 30
                 ),
Please login to merge, or discard this patch.