Completed
Push — master ( 65928f...2d3df6 )
by Lars
02:13
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/Property.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         $expectedTypes = \implode('|', $this->getTypes());
75 75
 
76
-        throw new \InvalidArgumentException("Invalid type: expected {$this->name} to be of type {{$expectedTypes}}, instead got value `" . \print_r($value, true) . "` with type {{$type}}.");
76
+        throw new \InvalidArgumentException("Invalid type: expected {$this->name} to be of type {{$expectedTypes}}, instead got value `".\print_r($value, true)."` with type {{$type}}.");
77 77
     }
78 78
 
79 79
     public static function fromPhpDocumentorProperty(\phpDocumentor\Reflection\DocBlock\Tags\Property $phpDocumentorReflectionProperty): self
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
         }
138 138
 
139 139
         if ($type instanceof \phpDocumentor\Reflection\Types\Array_) {
140
-            $valueTypeTmp = $type->getValueType() . '';
140
+            $valueTypeTmp = $type->getValueType().'';
141 141
             if ($valueTypeTmp !== 'mixed') {
142
-                return $valueTypeTmp . '[]';
142
+                return $valueTypeTmp.'[]';
143 143
             }
144 144
 
145 145
             return 'array';
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             return 'resource';
186 186
         }
187 187
 
188
-        return $type . '';
188
+        return $type.'';
189 189
     }
190 190
 
191 191
     /**
Please login to merge, or discard this patch.
src/Arrayy.php 3 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -955,25 +955,25 @@  discard block
 block discarded – undo
955 955
     {
956 956
         if ($recursive === true) {
957 957
             return \count(
958
-                       \array_intersect($needles, $this->keys(true)->getArray()),
959
-                       \COUNT_RECURSIVE
960
-                   )
961
-                   ===
962
-                   \count(
963
-                       $needles,
964
-                       \COUNT_RECURSIVE
965
-                   );
958
+                        \array_intersect($needles, $this->keys(true)->getArray()),
959
+                        \COUNT_RECURSIVE
960
+                    )
961
+                    ===
962
+                    \count(
963
+                        $needles,
964
+                        \COUNT_RECURSIVE
965
+                    );
966 966
         }
967 967
 
968 968
         return \count(
969
-                   \array_intersect($needles, $this->keys()->getArray()),
970
-                   \COUNT_NORMAL
971
-               )
972
-               ===
973
-               \count(
974
-                   $needles,
975
-                   \COUNT_NORMAL
976
-               );
969
+                    \array_intersect($needles, $this->keys()->getArray()),
970
+                    \COUNT_NORMAL
971
+                )
972
+                ===
973
+                \count(
974
+                    $needles,
975
+                    \COUNT_NORMAL
976
+                );
977 977
     }
978 978
 
979 979
     /**
@@ -1028,8 +1028,8 @@  discard block
 block discarded – undo
1028 1028
     public function containsValues(array $needles): bool
1029 1029
     {
1030 1030
         return \count(\array_intersect($needles, $this->getArray()), \COUNT_NORMAL)
1031
-               ===
1032
-               \count($needles, \COUNT_NORMAL);
1031
+                ===
1032
+                \count($needles, \COUNT_NORMAL);
1033 1033
     }
1034 1034
 
1035 1035
     /**
@@ -2170,15 +2170,15 @@  discard block
 block discarded – undo
2170 2170
 
2171 2171
         if ($recursive === true) {
2172 2172
             return $this->array_keys_recursive($this->getArray())
2173
-                   ===
2174
-                   \range(0, \count($this->getArray(), \COUNT_RECURSIVE) - 1);
2173
+                    ===
2174
+                    \range(0, \count($this->getArray(), \COUNT_RECURSIVE) - 1);
2175 2175
         }
2176 2176
 
2177 2177
         // non recursive
2178 2178
 
2179 2179
         return \array_keys($this->getArray())
2180
-               ===
2181
-               \range(0, \count($this->getArray(), \COUNT_NORMAL) - 1);
2180
+                ===
2181
+                \range(0, \count($this->getArray(), \COUNT_NORMAL) - 1);
2182 2182
     }
2183 2183
 
2184 2184
     /**
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4167,7 +4167,7 @@  discard block
 block discarded – undo
4167 4167
     }
4168 4168
 
4169 4169
     /**
4170
-     * @param mixed      $path
4170
+     * @param string      $path
4171 4171
      * @param callable   $callable
4172 4172
      * @param array|null $currentOffset
4173 4173
      */
@@ -4300,7 +4300,7 @@  discard block
 block discarded – undo
4300 4300
     }
4301 4301
 
4302 4302
     /**
4303
-     * @param mixed               $glue
4303
+     * @param string               $glue
4304 4304
      * @param array|static|string $pieces
4305 4305
      * @param bool                $useKeys
4306 4306
      *
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             &&
106 106
             \count(\array_diff_key($this->properties, $data)) > 0
107 107
         ) {
108
-            throw new \InvalidArgumentException('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($this->properties), true));
108
+            throw new \InvalidArgumentException('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($this->properties), true));
109 109
         }
110 110
 
111 111
         /** @noinspection AlterInForeachInspection */
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 
468 468
                     $this->callAtPath(
469 469
                         $containerPath,
470
-                        static function ($container) use ($lastOffset, &$offsetExists) {
470
+                        static function($container) use ($lastOffset, &$offsetExists) {
471 471
                             $offsetExists = \array_key_exists($lastOffset, $container);
472 472
                         }
473 473
                     );
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 
542 542
                 $this->callAtPath(
543 543
                     \implode($this->pathSeparator, $path),
544
-                    static function (&$offset) use ($pathToUnset) {
544
+                    static function(&$offset) use ($pathToUnset) {
545 545
                         unset($offset[$pathToUnset]);
546 546
                     }
547 547
                 );
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
         }
582 582
 
583 583
         if (\strpos($class, '\\') === 0) {
584
-            $class = '\\' . $class;
584
+            $class = '\\'.$class;
585 585
             if (\class_exists($class)) {
586 586
                 $this->iteratorClass = $class;
587 587
 
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
             }
590 590
         }
591 591
 
592
-        throw new \InvalidArgumentException('The iterator class does not exist: ' . $class);
592
+        throw new \InvalidArgumentException('The iterator class does not exist: '.$class);
593 593
     }
594 594
 
595 595
     /**
@@ -697,13 +697,13 @@  discard block
 block discarded – undo
697 697
 
698 698
         foreach ($this->getGenerator() as $key => $item) {
699 699
             if ($item instanceof self) {
700
-                $result[$prefix . $key] = $item->appendToEachKey($prefix);
700
+                $result[$prefix.$key] = $item->appendToEachKey($prefix);
701 701
             } elseif (\is_array($item)) {
702
-                $result[$prefix . $key] = self::create($item, $this->iteratorClass, false)
702
+                $result[$prefix.$key] = self::create($item, $this->iteratorClass, false)
703 703
                     ->appendToEachKey($prefix)
704 704
                     ->toArray();
705 705
             } else {
706
-                $result[$prefix . $key] = $item;
706
+                $result[$prefix.$key] = $item;
707 707
             }
708 708
         }
709 709
 
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
             } elseif (\is_object($item)) {
732 732
                 $result[$key] = $item;
733 733
             } else {
734
-                $result[$key] = $prefix . $item;
734
+                $result[$key] = $prefix.$item;
735 735
             }
736 736
         }
737 737
 
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
     public function clean(): self
883 883
     {
884 884
         return $this->filter(
885
-            static function ($value) {
885
+            static function($value) {
886 886
                 return (bool) $value;
887 887
             }
888 888
         );
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
             return $this->in_array_recursive(
949 949
                 \mb_strtoupper((string) $value),
950 950
                 $this->walk(
951
-                    static function (&$val) {
951
+                    static function(&$val) {
952 952
                         /** @noinspection PhpComposerExtensionStubsInspection */
953 953
                         $val = \mb_strtoupper((string) $val);
954 954
                     },
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
         return \in_array(
963 963
             \mb_strtoupper((string) $value),
964 964
             $this->walk(
965
-                static function (&$val) {
965
+                static function(&$val) {
966 966
                     /** @noinspection PhpComposerExtensionStubsInspection */
967 967
                     $val = \mb_strtoupper((string) $val);
968 968
                 },
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
         // trim all string in the array
1254 1254
         \array_walk(
1255 1255
             $array,
1256
-            static function (&$val) {
1256
+            static function(&$val) {
1257 1257
                 if (\is_string($val)) {
1258 1258
                     $val = \trim($val);
1259 1259
                 }
@@ -1581,40 +1581,40 @@  discard block
 block discarded – undo
1581 1581
         }
1582 1582
 
1583 1583
         $ops = [
1584
-            'eq' => static function ($item, $prop, $value) {
1584
+            'eq' => static function($item, $prop, $value) {
1585 1585
                 return $item[$prop] === $value;
1586 1586
             },
1587
-            'gt' => static function ($item, $prop, $value) {
1587
+            'gt' => static function($item, $prop, $value) {
1588 1588
                 return $item[$prop] > $value;
1589 1589
             },
1590
-            'ge' => static function ($item, $prop, $value) {
1590
+            'ge' => static function($item, $prop, $value) {
1591 1591
                 return $item[$prop] >= $value;
1592 1592
             },
1593
-            'gte' => static function ($item, $prop, $value) {
1593
+            'gte' => static function($item, $prop, $value) {
1594 1594
                 return $item[$prop] >= $value;
1595 1595
             },
1596
-            'lt' => static function ($item, $prop, $value) {
1596
+            'lt' => static function($item, $prop, $value) {
1597 1597
                 return $item[$prop] < $value;
1598 1598
             },
1599
-            'le' => static function ($item, $prop, $value) {
1599
+            'le' => static function($item, $prop, $value) {
1600 1600
                 return $item[$prop] <= $value;
1601 1601
             },
1602
-            'lte' => static function ($item, $prop, $value) {
1602
+            'lte' => static function($item, $prop, $value) {
1603 1603
                 return $item[$prop] <= $value;
1604 1604
             },
1605
-            'ne' => static function ($item, $prop, $value) {
1605
+            'ne' => static function($item, $prop, $value) {
1606 1606
                 return $item[$prop] !== $value;
1607 1607
             },
1608
-            'contains' => static function ($item, $prop, $value) {
1608
+            'contains' => static function($item, $prop, $value) {
1609 1609
                 return \in_array($item[$prop], (array) $value, true);
1610 1610
             },
1611
-            'notContains' => static function ($item, $prop, $value) {
1611
+            'notContains' => static function($item, $prop, $value) {
1612 1612
                 return !\in_array($item[$prop], (array) $value, true);
1613 1613
             },
1614
-            'newer' => static function ($item, $prop, $value) {
1614
+            'newer' => static function($item, $prop, $value) {
1615 1615
                 return \strtotime($item[$prop]) > \strtotime($value);
1616 1616
             },
1617
-            'older' => static function ($item, $prop, $value) {
1617
+            'older' => static function($item, $prop, $value) {
1618 1618
                 return \strtotime($item[$prop]) < \strtotime($value);
1619 1619
             },
1620 1620
         ];
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
         $result = \array_values(
1623 1623
             \array_filter(
1624 1624
                 $this->getArray(),
1625
-                static function ($item) use (
1625
+                static function($item) use (
1626 1626
                     $property,
1627 1627
                     $value,
1628 1628
                     $ops,
@@ -2170,7 +2170,7 @@  discard block
 block discarded – undo
2170 2170
                 \array_uintersect(
2171 2171
                     $this->array,
2172 2172
                     $search,
2173
-                    static function ($a, $b) {
2173
+                    static function($a, $b) {
2174 2174
                         return $a === $b ? 0 : -1;
2175 2175
                     }
2176 2176
                 ),
@@ -2387,13 +2387,13 @@  discard block
 block discarded – undo
2387 2387
         // non recursive
2388 2388
 
2389 2389
         if ($search_value === null) {
2390
-            $arrayFunction = function () {
2390
+            $arrayFunction = function() {
2391 2391
                 foreach ($this->getGenerator() as $key => $value) {
2392 2392
                     yield $key;
2393 2393
                 }
2394 2394
             };
2395 2395
         } else {
2396
-            $arrayFunction = function () use ($search_value, $strict) {
2396
+            $arrayFunction = function() use ($search_value, $strict) {
2397 2397
                 foreach ($this->getGenerator() as $key => $value) {
2398 2398
                     if ($strict) {
2399 2399
                         if ($search_value === $value) {
@@ -2558,7 +2558,7 @@  discard block
 block discarded – undo
2558 2558
         $useArguments = \func_num_args() > 2;
2559 2559
 
2560 2560
         return static::create(
2561
-            function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
2561
+            function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
2562 2562
                 foreach ($this->getGenerator() as $key => $value) {
2563 2563
                     if ($useArguments) {
2564 2564
                         if ($useKeyAsSecondParameter) {
@@ -2913,7 +2913,7 @@  discard block
 block discarded – undo
2913 2913
                 )->prependToEachKey($suffix)
2914 2914
                     ->toArray();
2915 2915
             } else {
2916
-                $result[$key . $suffix] = $item;
2916
+                $result[$key.$suffix] = $item;
2917 2917
             }
2918 2918
         }
2919 2919
 
@@ -2950,7 +2950,7 @@  discard block
 block discarded – undo
2950 2950
             } elseif (\is_object($item)) {
2951 2951
                 $result[$key] = $item;
2952 2952
             } else {
2953
-                $result[$key] = $item . $suffix;
2953
+                $result[$key] = $item.$suffix;
2954 2954
             }
2955 2955
         }
2956 2956
 
@@ -3482,7 +3482,7 @@  discard block
 block discarded – undo
3482 3482
     public function replaceValues($search, $replacement = ''): self
3483 3483
     {
3484 3484
         $array = $this->each(
3485
-            static function ($value) use ($search, $replacement) {
3485
+            static function($value) use ($search, $replacement) {
3486 3486
                 return \str_replace($search, $replacement, $value);
3487 3487
             }
3488 3488
         );
@@ -3981,7 +3981,7 @@  discard block
 block discarded – undo
3981 3981
             );
3982 3982
 
3983 3983
             $results = $arrayy->each(
3984
-                function ($value) use ($sorter) {
3984
+                function($value) use ($sorter) {
3985 3985
                     if (\is_callable($sorter)) {
3986 3986
                         return $sorter($value);
3987 3987
                     }
@@ -4043,7 +4043,7 @@  discard block
 block discarded – undo
4043 4043
     public function stripEmpty(): self
4044 4044
     {
4045 4045
         return $this->filter(
4046
-            static function ($item) {
4046
+            static function($item) {
4047 4047
                 if ($item === null) {
4048 4048
                     return false;
4049 4049
                 }
@@ -4128,7 +4128,7 @@  discard block
 block discarded – undo
4128 4128
         // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array
4129 4129
 
4130 4130
         $this->array = $this->reduce(
4131
-            static function ($resultArray, $value) {
4131
+            static function($resultArray, $value) {
4132 4132
                 if (!\in_array($value, $resultArray, true)) {
4133 4133
                     $resultArray[] = $value;
4134 4134
                 }
@@ -4157,7 +4157,7 @@  discard block
 block discarded – undo
4157 4157
 
4158 4158
         $this->array = \array_reduce(
4159 4159
             \array_keys($array),
4160
-            static function ($resultArray, $key) use ($array) {
4160
+            static function($resultArray, $key) use ($array) {
4161 4161
                 if (!\in_array($array[$key], $resultArray, true)) {
4162 4162
                     $resultArray[$key] = $array[$key];
4163 4163
                 }
@@ -4242,7 +4242,7 @@  discard block
 block discarded – undo
4242 4242
     public function values(): self
4243 4243
     {
4244 4244
         return static::create(
4245
-            function () {
4245
+            function() {
4246 4246
                 /** @noinspection YieldFromCanBeUsedInspection */
4247 4247
                 foreach ($this->getGenerator() as $value) {
4248 4248
                     yield $value;
@@ -4643,7 +4643,7 @@  discard block
 block discarded – undo
4643 4643
             $this->properties !== []
4644 4644
         ) {
4645 4645
             if (isset($this->properties[$key]) === false) {
4646
-                throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').');
4646
+                throw new \InvalidArgumentException('The key '.$key.' does not exists as @property in the class ('.\get_class($this).').');
4647 4647
             }
4648 4648
 
4649 4649
             $this->properties[$key]->checkType($value);
@@ -4795,7 +4795,7 @@  discard block
 block discarded – undo
4795 4795
     private function getPropertiesFromPhpDoc(): array
4796 4796
     {
4797 4797
         static $PROPERTY_CACHE = [];
4798
-        $cacheKey = 'Class::' . static::class;
4798
+        $cacheKey = 'Class::'.static::class;
4799 4799
 
4800 4800
         if (isset($PROPERTY_CACHE[$cacheKey])) {
4801 4801
             return $PROPERTY_CACHE[$cacheKey];
Please login to merge, or discard this patch.
src/Collection/AbstractCollection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function where(string $keyOrPropertyOrMethod, $value): CollectionInterface
172 172
     {
173 173
         return $this->filter(
174
-            function ($item) use ($keyOrPropertyOrMethod, $value) {
174
+            function($item) use ($keyOrPropertyOrMethod, $value) {
175 175
                 $accessorValue = $this->extractValue(
176 176
                     $item,
177 177
                     $keyOrPropertyOrMethod
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     {
206 206
         if ($this->checkType($this->collectionType, $value) === false) {
207 207
             throw new \InvalidArgumentException(
208
-                'Value must be of type ' . $this->collectionType . '; value is ' . $this->valueToString($value)
208
+                'Value must be of type '.$this->collectionType.'; value is '.$this->valueToString($value)
209 209
             );
210 210
         }
211 211
     }
@@ -318,10 +318,10 @@  discard block
 block discarded – undo
318 318
 
319 319
         // resource
320 320
         if (\is_resource($value)) {
321
-            return \get_resource_type($value) . ' resource #' . (int) $value;
321
+            return \get_resource_type($value).' resource #'.(int) $value;
322 322
         }
323 323
 
324 324
         // object
325
-        return \get_class($value) . ' Object';
325
+        return \get_class($value).' Object';
326 326
     }
327 327
 }
Please login to merge, or discard this patch.