Completed
Push — master ( a3c9ce...b5429f )
by Lars
01:04
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/TypeCheckPhpDoc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
         }
91 91
 
92 92
         if ($type instanceof \phpDocumentor\Reflection\Types\Array_) {
93
-            $valueTypeTmp = $type->getValueType() . '';
93
+            $valueTypeTmp = $type->getValueType().'';
94 94
             if ($valueTypeTmp !== 'mixed') {
95
-                return $valueTypeTmp . '[]';
95
+                return $valueTypeTmp.'[]';
96 96
             }
97 97
 
98 98
             return 'array';
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             return 'resource';
139 139
         }
140 140
 
141
-        return $type . '';
141
+        return $type.'';
142 142
     }
143 143
 
144 144
     /**
@@ -150,6 +150,6 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function throwException($expectedTypes, $value, $type): \Throwable
152 152
     {
153
-        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}}.");
153
+        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}}.");
154 154
     }
155 155
 }
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.
src/Collection/AbstractCollection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -290,9 +290,9 @@
 block discarded – undo
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
 
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
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         /**
333 333
          * @phpstan-return \Generator<TKey,T> $generator
334 334
          */
335
-        $generator = function () use ($key, $value): \Generator {
335
+        $generator = function() use ($key, $value): \Generator {
336 336
             if ($this->properties !== []) {
337 337
                 $this->checkType($key, $value);
338 338
             }
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 
521 521
             /** @phpstan-var \Arrayy\ArrayyRewindableGenerator<TKey,T> */
522 522
             $generatorTmp = new ArrayyRewindableExtendedGenerator(
523
-                static function () use ($generator): \Generator {
523
+                static function() use ($generator): \Generator {
524 524
                     yield from $generator;
525 525
                 },
526 526
                 null,
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
                  */
729 729
                 $this->callAtPath(
730 730
                     $containerPath,
731
-                    static function ($container) use ($lastOffset, &$offsetExists) {
731
+                    static function($container) use ($lastOffset, &$offsetExists) {
732 732
                         $offsetExists = \array_key_exists($lastOffset, $container);
733 733
                     }
734 734
                 );
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
                  */
834 834
                 $this->callAtPath(
835 835
                     \implode($this->pathSeparator, $path),
836
-                    static function (&$offset) use ($pathToUnset) {
836
+                    static function(&$offset) use ($pathToUnset) {
837 837
                         if (\is_array($offset)) {
838 838
                             unset($offset[$pathToUnset]);
839 839
                         } else {
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 
889 889
         if (\strpos($iteratorClass, '\\') === 0) {
890 890
             /** @var class-string<\Arrayy\ArrayyIterator<TKey,T>> $iteratorClass */
891
-            $iteratorClass = '\\' . $iteratorClass;
891
+            $iteratorClass = '\\'.$iteratorClass;
892 892
             if (\class_exists($iteratorClass)) {
893 893
                 /**
894 894
                  * @psalm-suppress PropertyTypeCoercion
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
             }
900 900
         }
901 901
 
902
-        throw new \InvalidArgumentException('The iterator class does not exist: ' . $iteratorClass);
902
+        throw new \InvalidArgumentException('The iterator class does not exist: '.$iteratorClass);
903 903
     }
904 904
 
905 905
     /**
@@ -1078,13 +1078,13 @@  discard block
 block discarded – undo
1078 1078
 
1079 1079
         foreach ($this->getGenerator() as $key => $item) {
1080 1080
             if ($item instanceof self) {
1081
-                $result[$prefix . $key] = $item->appendToEachKey($prefix);
1081
+                $result[$prefix.$key] = $item->appendToEachKey($prefix);
1082 1082
             } elseif (\is_array($item)) {
1083
-                $result[$prefix . $key] = self::create($item, $this->iteratorClass, false)
1083
+                $result[$prefix.$key] = self::create($item, $this->iteratorClass, false)
1084 1084
                     ->appendToEachKey($prefix)
1085 1085
                     ->toArray();
1086 1086
             } else {
1087
-                $result[$prefix . $key] = $item;
1087
+                $result[$prefix.$key] = $item;
1088 1088
             }
1089 1089
         }
1090 1090
 
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
             } elseif (\is_object($item) === true) {
1120 1120
                 $result[$key] = $item;
1121 1121
             } else {
1122
-                $result[$key] = $prefix . $item;
1122
+                $result[$key] = $prefix.$item;
1123 1123
             }
1124 1124
         }
1125 1125
 
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
     public function chunk($size, $preserveKeys = false): self
1305 1305
     {
1306 1306
         if ($preserveKeys) {
1307
-            $generator = function () use ($size) {
1307
+            $generator = function() use ($size) {
1308 1308
                 $values = [];
1309 1309
                 $tmpCounter = 0;
1310 1310
                 foreach ($this->getGenerator() as $key => $value) {
@@ -1324,7 +1324,7 @@  discard block
 block discarded – undo
1324 1324
                 }
1325 1325
             };
1326 1326
         } else {
1327
-            $generator = function () use ($size) {
1327
+            $generator = function() use ($size) {
1328 1328
                 $values = [];
1329 1329
                 $tmpCounter = 0;
1330 1330
                 foreach ($this->getGenerator() as $value) {
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
     public function clean(): self
1369 1369
     {
1370 1370
         return $this->filter(
1371
-            static function ($value) {
1371
+            static function($value) {
1372 1372
                 return (bool) $value;
1373 1373
             }
1374 1374
         );
@@ -1709,9 +1709,9 @@  discard block
 block discarded – undo
1709 1709
 
1710 1710
         foreach ($items as $key => $value) {
1711 1711
             if (\is_array($value) && $value !== []) {
1712
-                $flatten[] = $this->flatten($delimiter, $prepend . $key . $delimiter, $value);
1712
+                $flatten[] = $this->flatten($delimiter, $prepend.$key.$delimiter, $value);
1713 1713
             } else {
1714
-                $flatten[] = [$prepend . $key => $value];
1714
+                $flatten[] = [$prepend.$key => $value];
1715 1715
             }
1716 1716
         }
1717 1717
 
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
          */
1897 1897
         \array_walk(
1898 1898
             $array,
1899
-            static function (&$val) {
1899
+            static function(&$val) {
1900 1900
                 if ((string) $val === $val) {
1901 1901
                     $val = \trim($val);
1902 1902
                 }
@@ -2134,7 +2134,7 @@  discard block
 block discarded – undo
2134 2134
             $array = $array[0];
2135 2135
         }
2136 2136
 
2137
-        $generator = function () use ($array): \Generator {
2137
+        $generator = function() use ($array): \Generator {
2138 2138
             foreach ($this->getGenerator() as $key => $value) {
2139 2139
                 if (\in_array($value, $array, true) === false) {
2140 2140
                     yield $key => $value;
@@ -2169,7 +2169,7 @@  discard block
 block discarded – undo
2169 2169
             $array = $array[0];
2170 2170
         }
2171 2171
 
2172
-        $generator = function () use ($array): \Generator {
2172
+        $generator = function() use ($array): \Generator {
2173 2173
             foreach ($this->getGenerator() as $key => $value) {
2174 2174
                 if (\array_key_exists($key, $array) === false) {
2175 2175
                     yield $key => $value;
@@ -2204,7 +2204,7 @@  discard block
 block discarded – undo
2204 2204
             $array = $array[0];
2205 2205
         }
2206 2206
 
2207
-        $generator = function () use ($array): \Generator {
2207
+        $generator = function() use ($array): \Generator {
2208 2208
             foreach ($this->getGenerator() as $key => $value) {
2209 2209
                 $isset = isset($array[$key]);
2210 2210
 
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
         }
2514 2514
 
2515 2515
         if ($flag === \ARRAY_FILTER_USE_KEY) {
2516
-            $generator = function () use ($closure) {
2516
+            $generator = function() use ($closure) {
2517 2517
                 foreach ($this->getGenerator() as $key => $value) {
2518 2518
                     if ($closure($key) === true) {
2519 2519
                         yield $key => $value;
@@ -2525,7 +2525,7 @@  discard block
 block discarded – undo
2525 2525
             /** @phpstan-var \Closure(T=,TKey=):bool $closure */
2526 2526
             $closure = $closure;
2527 2527
 
2528
-            $generator = function () use ($closure) {
2528
+            $generator = function() use ($closure) {
2529 2529
                 foreach ($this->getGenerator() as $key => $value) {
2530 2530
                     if ($closure($value, $key) === true) {
2531 2531
                         yield $key => $value;
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
                 }
2534 2534
             };
2535 2535
         } else {
2536
-            $generator = function () use ($closure) {
2536
+            $generator = function() use ($closure) {
2537 2537
                 foreach ($this->getGenerator() as $key => $value) {
2538 2538
                     if ($closure($value) === true) {
2539 2539
                         yield $key => $value;
@@ -2589,40 +2589,40 @@  discard block
 block discarded – undo
2589 2589
         }
2590 2590
 
2591 2591
         $ops = [
2592
-            'eq' => static function ($item, $prop, $value): bool {
2592
+            'eq' => static function($item, $prop, $value): bool {
2593 2593
                 return $item[$prop] === $value;
2594 2594
             },
2595
-            'gt' => static function ($item, $prop, $value): bool {
2595
+            'gt' => static function($item, $prop, $value): bool {
2596 2596
                 return $item[$prop] > $value;
2597 2597
             },
2598
-            'ge' => static function ($item, $prop, $value): bool {
2598
+            'ge' => static function($item, $prop, $value): bool {
2599 2599
                 return $item[$prop] >= $value;
2600 2600
             },
2601
-            'gte' => static function ($item, $prop, $value): bool {
2601
+            'gte' => static function($item, $prop, $value): bool {
2602 2602
                 return $item[$prop] >= $value;
2603 2603
             },
2604
-            'lt' => static function ($item, $prop, $value): bool {
2604
+            'lt' => static function($item, $prop, $value): bool {
2605 2605
                 return $item[$prop] < $value;
2606 2606
             },
2607
-            'le' => static function ($item, $prop, $value): bool {
2607
+            'le' => static function($item, $prop, $value): bool {
2608 2608
                 return $item[$prop] <= $value;
2609 2609
             },
2610
-            'lte' => static function ($item, $prop, $value): bool {
2610
+            'lte' => static function($item, $prop, $value): bool {
2611 2611
                 return $item[$prop] <= $value;
2612 2612
             },
2613
-            'ne' => static function ($item, $prop, $value): bool {
2613
+            'ne' => static function($item, $prop, $value): bool {
2614 2614
                 return $item[$prop] !== $value;
2615 2615
             },
2616
-            'contains' => static function ($item, $prop, $value): bool {
2616
+            'contains' => static function($item, $prop, $value): bool {
2617 2617
                 return \in_array($item[$prop], (array) $value, true);
2618 2618
             },
2619
-            'notContains' => static function ($item, $prop, $value): bool {
2619
+            'notContains' => static function($item, $prop, $value): bool {
2620 2620
                 return !\in_array($item[$prop], (array) $value, true);
2621 2621
             },
2622
-            'newer' => static function ($item, $prop, $value): bool {
2622
+            'newer' => static function($item, $prop, $value): bool {
2623 2623
                 return \strtotime($item[$prop]) > \strtotime($value);
2624 2624
             },
2625
-            'older' => static function ($item, $prop, $value): bool {
2625
+            'older' => static function($item, $prop, $value): bool {
2626 2626
                 return \strtotime($item[$prop]) < \strtotime($value);
2627 2627
             },
2628 2628
         ];
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
         $result = \array_values(
2631 2631
             \array_filter(
2632 2632
                 $this->toArray(false, true),
2633
-                static function ($item) use (
2633
+                static function($item) use (
2634 2634
                     $property,
2635 2635
                     $value,
2636 2636
                     $ops,
@@ -2860,7 +2860,7 @@  discard block
 block discarded – undo
2860 2860
      */
2861 2861
     public function flip(): self
2862 2862
     {
2863
-        $generator = function (): \Generator {
2863
+        $generator = function(): \Generator {
2864 2864
             foreach ($this->getGenerator() as $key => $value) {
2865 2865
                 yield (string) $value => $key;
2866 2866
             }
@@ -3138,9 +3138,9 @@  discard block
 block discarded – undo
3138 3138
         $jsonObject = \json_decode($json, false);
3139 3139
 
3140 3140
         $mapper = new \Arrayy\Mapper\Json();
3141
-        $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($class) {
3141
+        $mapper->undefinedPropertyHandler = static function($object, $key, $jsonValue) use ($class) {
3142 3142
             if ($class->checkPropertiesMismatchInConstructor) {
3143
-                throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object));
3143
+                throw new \TypeError('Property mismatch - input: '.\print_r(['key' => $key, 'jsonValue' => $jsonValue], true).' for object: '.\get_class($object));
3144 3144
             }
3145 3145
         };
3146 3146
 
@@ -3205,13 +3205,13 @@  discard block
 block discarded – undo
3205 3205
     public function getColumn($columnKey = null, $indexKey = null): self
3206 3206
     {
3207 3207
         if ($columnKey === null && $indexKey === null) {
3208
-            $generator = function () {
3208
+            $generator = function() {
3209 3209
                 foreach ($this->getGenerator() as $value) {
3210 3210
                     yield $value;
3211 3211
                 }
3212 3212
             };
3213 3213
         } else {
3214
-            $generator = function () use ($columnKey, $indexKey) {
3214
+            $generator = function() use ($columnKey, $indexKey) {
3215 3215
                 foreach ($this->getGenerator() as $value) {
3216 3216
                     // reset
3217 3217
                     $newKey = null;
@@ -3517,7 +3517,7 @@  discard block
 block discarded – undo
3517 3517
 
3518 3518
         if ($UN_FOUND === null) {
3519 3519
             // Generate unique string to use as marker.
3520
-            $UN_FOUND = 'arrayy--' . \uniqid('arrayy', true);
3520
+            $UN_FOUND = 'arrayy--'.\uniqid('arrayy', true);
3521 3521
         }
3522 3522
 
3523 3523
         if (\is_array($key)) {
@@ -3569,7 +3569,7 @@  discard block
 block discarded – undo
3569 3569
      */
3570 3570
     public function implode(string $glue = '', string $prefix = ''): string
3571 3571
     {
3572
-        return $prefix . $this->implode_recursive($glue, $this->toArray(), false);
3572
+        return $prefix.$this->implode_recursive($glue, $this->toArray(), false);
3573 3573
     }
3574 3574
 
3575 3575
     /**
@@ -3683,7 +3683,7 @@  discard block
 block discarded – undo
3683 3683
                 \array_uintersect(
3684 3684
                     $this->toArray(),
3685 3685
                     $search,
3686
-                    static function ($a, $b) {
3686
+                    static function($a, $b) {
3687 3687
                         return $a === $b ? 0 : -1;
3688 3688
                     }
3689 3689
                 ),
@@ -4033,13 +4033,13 @@  discard block
 block discarded – undo
4033 4033
         // non recursive
4034 4034
 
4035 4035
         if ($search_values === null) {
4036
-            $arrayFunction = function (): \Generator {
4036
+            $arrayFunction = function(): \Generator {
4037 4037
                 foreach ($this->getGenerator() as $key => $value) {
4038 4038
                     yield $key;
4039 4039
                 }
4040 4040
             };
4041 4041
         } else {
4042
-            $arrayFunction = function () use ($search_values, $strict): \Generator {
4042
+            $arrayFunction = function() use ($search_values, $strict): \Generator {
4043 4043
                 $is_array_tmp = \is_array($search_values);
4044 4044
 
4045 4045
                 /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */
@@ -4293,7 +4293,7 @@  discard block
 block discarded – undo
4293 4293
         $useArguments = \func_num_args() > 2;
4294 4294
 
4295 4295
         return static::create(
4296
-            function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
4296
+            function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
4297 4297
                 foreach ($this->getGenerator() as $key => $value) {
4298 4298
                     if ($useArguments) {
4299 4299
                         if ($useKeyAsSecondParameter) {
@@ -4797,7 +4797,7 @@  discard block
 block discarded – undo
4797 4797
      */
4798 4798
     public function nth(int $step, int $offset = 0): self
4799 4799
     {
4800
-        $arrayFunction = function () use ($step, $offset): \Generator {
4800
+        $arrayFunction = function() use ($step, $offset): \Generator {
4801 4801
             $position = 0;
4802 4802
             foreach ($this->getGenerator() as $key => $value) {
4803 4803
                 if ($position++ % $step !== $offset) {
@@ -4831,7 +4831,7 @@  discard block
 block discarded – undo
4831 4831
     {
4832 4832
         $keys = \array_flip($keys);
4833 4833
 
4834
-        $generator = function () use ($keys): \Generator {
4834
+        $generator = function() use ($keys): \Generator {
4835 4835
             foreach ($this->getGenerator() as $key => $value) {
4836 4836
                 if (isset($keys[$key])) {
4837 4837
                     yield $key => $value;
@@ -4968,7 +4968,7 @@  discard block
 block discarded – undo
4968 4968
      */
4969 4969
     public function prependImmutable($value, $key = null)
4970 4970
     {
4971
-        $generator = function () use ($key, $value): \Generator {
4971
+        $generator = function() use ($key, $value): \Generator {
4972 4972
             if ($this->properties !== []) {
4973 4973
                 $this->checkType($key, $value);
4974 4974
             }
@@ -5018,7 +5018,7 @@  discard block
 block discarded – undo
5018 5018
                 )->prependToEachKey($suffix)
5019 5019
                     ->toArray();
5020 5020
             } else {
5021
-                $result[$key . $suffix] = $item;
5021
+                $result[$key.$suffix] = $item;
5022 5022
             }
5023 5023
         }
5024 5024
 
@@ -5058,7 +5058,7 @@  discard block
 block discarded – undo
5058 5058
             } elseif (\is_object($item) === true) {
5059 5059
                 $result[$key] = $item;
5060 5060
             } else {
5061
-                $result[$key] = $item . $suffix;
5061
+                $result[$key] = $item.$suffix;
5062 5062
             }
5063 5063
         }
5064 5064
 
@@ -5880,7 +5880,7 @@  discard block
 block discarded – undo
5880 5880
      */
5881 5881
     public function replaceValues($search, $replacement = ''): self
5882 5882
     {
5883
-        $callable = static function ($value) use ($search, $replacement) {
5883
+        $callable = static function($value) use ($search, $replacement) {
5884 5884
             return \str_replace($search, $replacement, $value);
5885 5885
         };
5886 5886
 
@@ -6585,7 +6585,7 @@  discard block
 block discarded – undo
6585 6585
              * @psalm-suppress MissingClosureParamType
6586 6586
              */
6587 6587
             $results = $arrayy->each(
6588
-                static function ($value) use ($sorter) {
6588
+                static function($value) use ($sorter) {
6589 6589
                     if (\is_callable($sorter) === true) {
6590 6590
                         return $sorter($value);
6591 6591
                     }
@@ -6658,7 +6658,7 @@  discard block
 block discarded – undo
6658 6658
     public function split(int $numberOfPieces = 2, bool $keepKeys = false): self
6659 6659
     {
6660 6660
         if ($keepKeys) {
6661
-            $generator = function () use ($numberOfPieces) {
6661
+            $generator = function() use ($numberOfPieces) {
6662 6662
                 $carry = [];
6663 6663
                 $i = 1;
6664 6664
                 foreach ($this->getGenerator() as $key => $value) {
@@ -6681,7 +6681,7 @@  discard block
 block discarded – undo
6681 6681
                 }
6682 6682
             };
6683 6683
         } else {
6684
-            $generator = function () use ($numberOfPieces) {
6684
+            $generator = function() use ($numberOfPieces) {
6685 6685
                 $carry = [];
6686 6686
                 $i = 1;
6687 6687
                 foreach ($this->getGenerator() as $value) {
@@ -6728,7 +6728,7 @@  discard block
 block discarded – undo
6728 6728
     public function stripEmpty(): self
6729 6729
     {
6730 6730
         return $this->filter(
6731
-            static function ($item) {
6731
+            static function($item) {
6732 6732
                 if ($item === null) {
6733 6733
                     return false;
6734 6734
                 }
@@ -6933,7 +6933,7 @@  discard block
 block discarded – undo
6933 6933
 
6934 6934
         /** @phpstan-ignore-next-line - reduce will return an array of T */
6935 6935
         $this->array = $this->reduce(
6936
-            static function ($resultArray, $value, $key) {
6936
+            static function($resultArray, $value, $key) {
6937 6937
                 if (!\in_array($value, $resultArray, true)) {
6938 6938
                     $resultArray[] = $value;
6939 6939
                 }
@@ -6972,7 +6972,7 @@  discard block
 block discarded – undo
6972 6972
          */
6973 6973
         $this->array = \array_reduce(
6974 6974
             \array_keys($array),
6975
-            static function ($resultArray, $key) use ($array) {
6975
+            static function($resultArray, $key) use ($array) {
6976 6976
                 if (!\in_array($array[$key], $resultArray, true)) {
6977 6977
                     $resultArray[$key] = $array[$key];
6978 6978
                 }
@@ -7069,7 +7069,7 @@  discard block
 block discarded – undo
7069 7069
     public function values(): self
7070 7070
     {
7071 7071
         return static::create(
7072
-            function () {
7072
+            function() {
7073 7073
                 foreach ($this->getGenerator() as $value) {
7074 7074
                     yield $value;
7075 7075
                 }
@@ -7153,7 +7153,7 @@  discard block
 block discarded – undo
7153 7153
     public function where(string $keyOrPropertyOrMethod, $value): self
7154 7154
     {
7155 7155
         return $this->filter(
7156
-            function ($item) use ($keyOrPropertyOrMethod, $value) {
7156
+            function($item) use ($keyOrPropertyOrMethod, $value) {
7157 7157
                 $accessorValue = $this->extractValue(
7158 7158
                     $item,
7159 7159
                     $keyOrPropertyOrMethod
@@ -7450,7 +7450,7 @@  discard block
 block discarded – undo
7450 7450
     protected function getPropertiesFromPhpDoc()
7451 7451
     {
7452 7452
         static $PROPERTY_CACHE = [];
7453
-        $cacheKey = 'Class::' . static::class;
7453
+        $cacheKey = 'Class::'.static::class;
7454 7454
 
7455 7455
         if (isset($PROPERTY_CACHE[$cacheKey])) {
7456 7456
             return $PROPERTY_CACHE[$cacheKey];
@@ -7765,7 +7765,7 @@  discard block
 block discarded – undo
7765 7765
         if ($array === null) {
7766 7766
             $array = [];
7767 7767
         } elseif (!\is_array($array)) {
7768
-            throw new \RuntimeException('Can not set value at this path "' . $key . '" because (' . \gettype($array) . ')"' . \print_r($array, true) . '" is not an array.');
7768
+            throw new \RuntimeException('Can not set value at this path "'.$key.'" because ('.\gettype($array).')"'.\print_r($array, true).'" is not an array.');
7769 7769
         }
7770 7770
 
7771 7771
         $array[$key] = $value;
@@ -7837,7 +7837,7 @@  discard block
 block discarded – undo
7837 7837
                 &&
7838 7838
                 \count(\array_diff_key($properties, $data)) > 0
7839 7839
             ) {
7840
-                throw new \TypeError('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($properties), true));
7840
+                throw new \TypeError('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($properties), true));
7841 7841
             }
7842 7842
 
7843 7843
             foreach ($data as $key => &$valueInner) {
@@ -7954,7 +7954,7 @@  discard block
 block discarded – undo
7954 7954
              *
7955 7955
              * @return void
7956 7956
              */
7957
-            static function (&$item) {
7957
+            static function(&$item) {
7958 7958
                 if ($item instanceof self) {
7959 7959
                     $item = $item->getArray();
7960 7960
                 }
@@ -7979,7 +7979,7 @@  discard block
 block discarded – undo
7979 7979
             &&
7980 7980
             $this->checkPropertiesMismatch === true
7981 7981
         ) {
7982
-            throw new \TypeError('The key "' . $key . '" does not exists as "@property" phpdoc. (' . \get_class($this) . ').');
7982
+            throw new \TypeError('The key "'.$key.'" does not exists as "@property" phpdoc. ('.\get_class($this).').');
7983 7983
         }
7984 7984
 
7985 7985
         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.