Completed
Push — master ( 35eefd...6ead31 )
by Lars
06:45 queued 12s
created
src/Arrayy.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
                  */
626 626
                 $this->callAtPath(
627 627
                     $containerPath,
628
-                    static function ($container) use ($lastOffset, &$offsetExists) {
628
+                    static function($container) use ($lastOffset, &$offsetExists) {
629 629
                         $offsetExists = \array_key_exists($lastOffset, $container);
630 630
                     }
631 631
                 );
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
                  */
721 721
                 $this->callAtPath(
722 722
                     \implode($this->pathSeparator, $path),
723
-                    static function (&$offset) use ($pathToUnset) {
723
+                    static function(&$offset) use ($pathToUnset) {
724 724
                         unset($offset[$pathToUnset]);
725 725
                     }
726 726
                 );
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
         }
767 767
 
768 768
         if (\strpos($iteratorClass, '\\') === 0) {
769
-            $iteratorClass = '\\' . $iteratorClass;
769
+            $iteratorClass = '\\'.$iteratorClass;
770 770
             if (\class_exists($iteratorClass)) {
771 771
                 /**
772 772
                  * @psalm-suppress PropertyTypeCoercion
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
             }
778 778
         }
779 779
 
780
-        throw new \InvalidArgumentException('The iterator class does not exist: ' . $iteratorClass);
780
+        throw new \InvalidArgumentException('The iterator class does not exist: '.$iteratorClass);
781 781
     }
782 782
 
783 783
     /**
@@ -943,13 +943,13 @@  discard block
 block discarded – undo
943 943
 
944 944
         foreach ($this->getGenerator() as $key => $item) {
945 945
             if ($item instanceof self) {
946
-                $result[$prefix . $key] = $item->appendToEachKey($prefix);
946
+                $result[$prefix.$key] = $item->appendToEachKey($prefix);
947 947
             } elseif (\is_array($item) === true) {
948
-                $result[$prefix . $key] = self::create($item, $this->iteratorClass, false)
948
+                $result[$prefix.$key] = self::create($item, $this->iteratorClass, false)
949 949
                     ->appendToEachKey($prefix)
950 950
                     ->toArray();
951 951
             } else {
952
-                $result[$prefix . $key] = $item;
952
+                $result[$prefix.$key] = $item;
953 953
             }
954 954
         }
955 955
 
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
             } elseif (\is_object($item) === true) {
981 981
                 $result[$key] = $item;
982 982
             } else {
983
-                $result[$key] = $prefix . $item;
983
+                $result[$key] = $prefix.$item;
984 984
             }
985 985
         }
986 986
 
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
     public function clean(): self
1167 1167
     {
1168 1168
         return $this->filter(
1169
-            static function ($value) {
1169
+            static function($value) {
1170 1170
                 return (bool) $value;
1171 1171
             }
1172 1172
         );
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
          */
1580 1580
         \array_walk(
1581 1581
             $array,
1582
-            static function (&$val) {
1582
+            static function(&$val) {
1583 1583
                 if ((string) $val === $val) {
1584 1584
                     $val = \trim($val);
1585 1585
                 }
@@ -2088,40 +2088,40 @@  discard block
 block discarded – undo
2088 2088
         }
2089 2089
 
2090 2090
         $ops = [
2091
-            'eq' => static function ($item, $prop, $value): bool {
2091
+            'eq' => static function($item, $prop, $value): bool {
2092 2092
                 return $item[$prop] === $value;
2093 2093
             },
2094
-            'gt' => static function ($item, $prop, $value): bool {
2094
+            'gt' => static function($item, $prop, $value): bool {
2095 2095
                 return $item[$prop] > $value;
2096 2096
             },
2097
-            'ge' => static function ($item, $prop, $value): bool {
2097
+            'ge' => static function($item, $prop, $value): bool {
2098 2098
                 return $item[$prop] >= $value;
2099 2099
             },
2100
-            'gte' => static function ($item, $prop, $value): bool {
2100
+            'gte' => static function($item, $prop, $value): bool {
2101 2101
                 return $item[$prop] >= $value;
2102 2102
             },
2103
-            'lt' => static function ($item, $prop, $value): bool {
2103
+            'lt' => static function($item, $prop, $value): bool {
2104 2104
                 return $item[$prop] < $value;
2105 2105
             },
2106
-            'le' => static function ($item, $prop, $value): bool {
2106
+            'le' => static function($item, $prop, $value): bool {
2107 2107
                 return $item[$prop] <= $value;
2108 2108
             },
2109
-            'lte' => static function ($item, $prop, $value): bool {
2109
+            'lte' => static function($item, $prop, $value): bool {
2110 2110
                 return $item[$prop] <= $value;
2111 2111
             },
2112
-            'ne' => static function ($item, $prop, $value): bool {
2112
+            'ne' => static function($item, $prop, $value): bool {
2113 2113
                 return $item[$prop] !== $value;
2114 2114
             },
2115
-            'contains' => static function ($item, $prop, $value): bool {
2115
+            'contains' => static function($item, $prop, $value): bool {
2116 2116
                 return \in_array($item[$prop], (array) $value, true);
2117 2117
             },
2118
-            'notContains' => static function ($item, $prop, $value): bool {
2118
+            'notContains' => static function($item, $prop, $value): bool {
2119 2119
                 return !\in_array($item[$prop], (array) $value, true);
2120 2120
             },
2121
-            'newer' => static function ($item, $prop, $value): bool {
2121
+            'newer' => static function($item, $prop, $value): bool {
2122 2122
                 return \strtotime($item[$prop]) > \strtotime($value);
2123 2123
             },
2124
-            'older' => static function ($item, $prop, $value): bool {
2124
+            'older' => static function($item, $prop, $value): bool {
2125 2125
                 return \strtotime($item[$prop]) < \strtotime($value);
2126 2126
             },
2127 2127
         ];
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
         $result = \array_values(
2130 2130
             \array_filter(
2131 2131
                 $this->toArray(false, true),
2132
-                static function ($item) use (
2132
+                static function($item) use (
2133 2133
                     $property,
2134 2134
                     $value,
2135 2135
                     $ops,
@@ -2866,7 +2866,7 @@  discard block
 block discarded – undo
2866 2866
                 \array_uintersect(
2867 2867
                     $this->toArray(),
2868 2868
                     $search,
2869
-                    static function ($a, $b) {
2869
+                    static function($a, $b) {
2870 2870
                         return $a === $b ? 0 : -1;
2871 2871
                     }
2872 2872
                 ),
@@ -3161,13 +3161,13 @@  discard block
 block discarded – undo
3161 3161
         // non recursive
3162 3162
 
3163 3163
         if ($search_values === null) {
3164
-            $arrayFunction = function (): \Generator {
3164
+            $arrayFunction = function(): \Generator {
3165 3165
                 foreach ($this->getGenerator() as $key => $value) {
3166 3166
                     yield $key;
3167 3167
                 }
3168 3168
             };
3169 3169
         } else {
3170
-            $arrayFunction = function () use ($search_values, $strict): \Generator {
3170
+            $arrayFunction = function() use ($search_values, $strict): \Generator {
3171 3171
                 $is_array_tmp = \is_array($search_values);
3172 3172
 
3173 3173
                 foreach ($this->getGenerator() as $key => $value) {
@@ -3413,7 +3413,7 @@  discard block
 block discarded – undo
3413 3413
         $useArguments = \func_num_args() > 2;
3414 3414
 
3415 3415
         return static::create(
3416
-            function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
3416
+            function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
3417 3417
                 foreach ($this->getGenerator() as $key => $value) {
3418 3418
                     if ($useArguments) {
3419 3419
                         if ($useKeyAsSecondParameter) {
@@ -3829,7 +3829,7 @@  discard block
 block discarded – undo
3829 3829
      */
3830 3830
     public function nth(int $step, int $offset = 0): self
3831 3831
     {
3832
-        $arrayFunction = function () use ($step, $offset): \Generator {
3832
+        $arrayFunction = function() use ($step, $offset): \Generator {
3833 3833
             $position = 0;
3834 3834
             foreach ($this->getGenerator() as $key => $value) {
3835 3835
                 if ($position++ % $step !== $offset) {
@@ -3989,7 +3989,7 @@  discard block
 block discarded – undo
3989 3989
                 )->prependToEachKey($suffix)
3990 3990
                     ->toArray();
3991 3991
             } else {
3992
-                $result[$key . $suffix] = $item;
3992
+                $result[$key.$suffix] = $item;
3993 3993
             }
3994 3994
         }
3995 3995
 
@@ -4029,7 +4029,7 @@  discard block
 block discarded – undo
4029 4029
             } elseif (\is_object($item) === true) {
4030 4030
                 $result[$key] = $item;
4031 4031
             } else {
4032
-                $result[$key] = $item . $suffix;
4032
+                $result[$key] = $item.$suffix;
4033 4033
             }
4034 4034
         }
4035 4035
 
@@ -4721,7 +4721,7 @@  discard block
 block discarded – undo
4721 4721
          * @psalm-suppress MissingClosureParamType
4722 4722
          */
4723 4723
         return $this->each(
4724
-            static function ($value) use ($search, $replacement) {
4724
+            static function($value) use ($search, $replacement) {
4725 4725
                 return \str_replace($search, $replacement, $value);
4726 4726
             }
4727 4727
         );
@@ -5346,7 +5346,7 @@  discard block
 block discarded – undo
5346 5346
              * @psalm-suppress MissingClosureParamType
5347 5347
              */
5348 5348
             $results = $arrayy->each(
5349
-                function ($value) use ($sorter) {
5349
+                function($value) use ($sorter) {
5350 5350
                     if (\is_callable($sorter) === true) {
5351 5351
                         return $sorter($value);
5352 5352
                     }
@@ -5444,7 +5444,7 @@  discard block
 block discarded – undo
5444 5444
     public function stripEmpty(): self
5445 5445
     {
5446 5446
         return $this->filter(
5447
-            static function ($item) {
5447
+            static function($item) {
5448 5448
                 if ($item === null) {
5449 5449
                     return false;
5450 5450
                 }
@@ -5633,7 +5633,7 @@  discard block
 block discarded – undo
5633 5633
          * @psalm-suppress MissingClosureParamType
5634 5634
          */
5635 5635
         $this->array = $this->reduce(
5636
-            static function ($resultArray, $value) {
5636
+            static function($resultArray, $value) {
5637 5637
                 if (!\in_array($value, $resultArray, true)) {
5638 5638
                     $resultArray[] = $value;
5639 5639
                 }
@@ -5668,7 +5668,7 @@  discard block
 block discarded – undo
5668 5668
          */
5669 5669
         $this->array = \array_reduce(
5670 5670
             \array_keys($array),
5671
-            static function ($resultArray, $key) use ($array) {
5671
+            static function($resultArray, $key) use ($array) {
5672 5672
                 if (!\in_array($array[$key], $resultArray, true)) {
5673 5673
                     $resultArray[$key] = $array[$key];
5674 5674
                 }
@@ -5748,7 +5748,7 @@  discard block
 block discarded – undo
5748 5748
     public function values(): self
5749 5749
     {
5750 5750
         return static::create(
5751
-            function () {
5751
+            function() {
5752 5752
                 /** @noinspection YieldFromCanBeUsedInspection */
5753 5753
                 foreach ($this->getGenerator() as $value) {
5754 5754
                     yield $value;
@@ -5799,7 +5799,7 @@  discard block
 block discarded – undo
5799 5799
     public function where(string $keyOrPropertyOrMethod, $value): self
5800 5800
     {
5801 5801
         return $this->filter(
5802
-            function ($item) use ($keyOrPropertyOrMethod, $value) {
5802
+            function($item) use ($keyOrPropertyOrMethod, $value) {
5803 5803
                 $accessorValue = $this->extractValue(
5804 5804
                     $item,
5805 5805
                     $keyOrPropertyOrMethod
@@ -6089,7 +6089,7 @@  discard block
 block discarded – undo
6089 6089
     protected function getPropertiesFromPhpDoc()
6090 6090
     {
6091 6091
         static $PROPERTY_CACHE = [];
6092
-        $cacheKey = 'Class::' . static::class;
6092
+        $cacheKey = 'Class::'.static::class;
6093 6093
 
6094 6094
         if (isset($PROPERTY_CACHE[$cacheKey])) {
6095 6095
             return $PROPERTY_CACHE[$cacheKey];
@@ -6427,7 +6427,7 @@  discard block
 block discarded – undo
6427 6427
                 &&
6428 6428
                 \count(\array_diff_key($properties, $data)) > 0
6429 6429
             ) {
6430
-                throw new \TypeError('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($properties), true));
6430
+                throw new \TypeError('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($properties), true));
6431 6431
             }
6432 6432
 
6433 6433
             foreach ($data as $key => &$valueInner) {
@@ -6535,7 +6535,7 @@  discard block
 block discarded – undo
6535 6535
             &&
6536 6536
             $this->checkPropertiesMismatch === true
6537 6537
         ) {
6538
-            throw new \TypeError('The key ' . $key . ' does not exists in "properties". Maybe because @property was not used for the class (' . \get_class($this) . ').');
6538
+            throw new \TypeError('The key '.$key.' does not exists in "properties". Maybe because @property was not used for the class ('.\get_class($this).').');
6539 6539
         }
6540 6540
 
6541 6541
         if (isset($this->properties[self::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES])) {
Please login to merge, or discard this patch.