Completed
Push — master ( 9da4f3...caa7ee )
by Lars
02:50 queued 11s
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/Collection/AbstractCollection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     public function where(string $keyOrPropertyOrMethod, $value): CollectionInterface
196 196
     {
197 197
         return $this->filter(
198
-            function ($item) use ($keyOrPropertyOrMethod, $value) {
198
+            function($item) use ($keyOrPropertyOrMethod, $value) {
199 199
                 $accessorValue = $this->extractValue(
200 200
                     $item,
201 201
                     $keyOrPropertyOrMethod
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     {
238 238
         if ($this->checkType($this->collectionType, $value) === false) {
239 239
             throw new \InvalidArgumentException(
240
-                'Value must be of type ' . $this->collectionType . '; type is ' . \gettype($value) . ', value is "' . $this->valueToString($value) . '"'
240
+                'Value must be of type '.$this->collectionType.'; type is '.\gettype($value).', value is "'.$this->valueToString($value).'"'
241 241
             );
242 242
         }
243 243
     }
@@ -350,10 +350,10 @@  discard block
 block discarded – undo
350 350
 
351 351
         // resource
352 352
         if (\is_resource($value)) {
353
-            return \get_resource_type($value) . ' resource #' . (int) $value;
353
+            return \get_resource_type($value).' resource #'.(int) $value;
354 354
         }
355 355
 
356 356
         // object
357
-        return \get_class($value) . ' Object';
357
+        return \get_class($value).' Object';
358 358
     }
359 359
 }
Please login to merge, or discard this patch.
src/Arrayy.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1594,7 +1594,7 @@  discard block
 block discarded – undo
1594 1594
      * property within that.
1595 1595
      *
1596 1596
      * @param string          $property
1597
-     * @param string|string[] $value
1597
+     * @param string $value
1598 1598
      * @param string          $comparisonOp
1599 1599
      *                                      <p>
1600 1600
      *                                      'eq' (equals),<br />
@@ -4604,7 +4604,7 @@  discard block
 block discarded – undo
4604 4604
     }
4605 4605
 
4606 4606
     /**
4607
-     * @param mixed      $path
4607
+     * @param string      $path
4608 4608
      * @param callable   $callable
4609 4609
      * @param array|null $currentOffset
4610 4610
      */
@@ -4699,7 +4699,7 @@  discard block
 block discarded – undo
4699 4699
     }
4700 4700
 
4701 4701
     /**
4702
-     * @param mixed $glue
4702
+     * @param string $glue
4703 4703
      * @param mixed $pieces
4704 4704
      * @param bool  $useKeys
4705 4705
      *
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1003,11 +1003,11 @@  discard block
 block discarded – undo
1003 1003
             \array_intersect($needles, $this->keys()->getArray()),
1004 1004
             \COUNT_NORMAL
1005 1005
         )
1006
-               ===
1007
-               \count(
1008
-                   $needles,
1009
-                   \COUNT_NORMAL
1010
-               );
1006
+                ===
1007
+                \count(
1008
+                    $needles,
1009
+                    \COUNT_NORMAL
1010
+                );
1011 1011
     }
1012 1012
 
1013 1013
     /**
@@ -1062,8 +1062,8 @@  discard block
 block discarded – undo
1062 1062
     public function containsValues(array $needles): bool
1063 1063
     {
1064 1064
         return \count(\array_intersect($needles, $this->getArray()), \COUNT_NORMAL)
1065
-               ===
1066
-               \count($needles, \COUNT_NORMAL);
1065
+                ===
1066
+                \count($needles, \COUNT_NORMAL);
1067 1067
     }
1068 1068
 
1069 1069
     /**
@@ -2516,15 +2516,15 @@  discard block
 block discarded – undo
2516 2516
 
2517 2517
         if ($recursive === true) {
2518 2518
             return $this->array_keys_recursive($this->getArray())
2519
-                   ===
2520
-                   \range(0, \count($this->getArray(), \COUNT_RECURSIVE) - 1);
2519
+                    ===
2520
+                    \range(0, \count($this->getArray(), \COUNT_RECURSIVE) - 1);
2521 2521
         }
2522 2522
 
2523 2523
         // non recursive
2524 2524
 
2525 2525
         return \array_keys($this->getArray())
2526
-               ===
2527
-               \range(0, \count($this->getArray(), \COUNT_NORMAL) - 1);
2526
+                ===
2527
+                \range(0, \count($this->getArray(), \COUNT_NORMAL) - 1);
2528 2528
     }
2529 2529
 
2530 2530
     /**
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             &&
102 102
             \count(\array_diff_key($this->properties, $data)) > 0
103 103
         ) {
104
-            throw new \InvalidArgumentException('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($this->properties), true));
104
+            throw new \InvalidArgumentException('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($this->properties), true));
105 105
         }
106 106
 
107 107
         /** @noinspection AlterInForeachInspection */
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 
464 464
                     $this->callAtPath(
465 465
                         $containerPath,
466
-                        static function ($container) use ($lastOffset, &$offsetExists) {
466
+                        static function($container) use ($lastOffset, &$offsetExists) {
467 467
                             $offsetExists = \array_key_exists($lastOffset, $container);
468 468
                         }
469 469
                     );
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 
538 538
                 $this->callAtPath(
539 539
                     \implode($this->pathSeparator, $path),
540
-                    static function (&$offset) use ($pathToUnset) {
540
+                    static function(&$offset) use ($pathToUnset) {
541 541
                         unset($offset[$pathToUnset]);
542 542
                     }
543 543
                 );
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
         }
576 576
 
577 577
         if (\strpos($class, '\\') === 0) {
578
-            $class = '\\' . $class;
578
+            $class = '\\'.$class;
579 579
             if (\class_exists($class)) {
580 580
                 $this->iteratorClass = $class;
581 581
 
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
             }
584 584
         }
585 585
 
586
-        throw new \InvalidArgumentException('The iterator class does not exist: ' . $class);
586
+        throw new \InvalidArgumentException('The iterator class does not exist: '.$class);
587 587
     }
588 588
 
589 589
     /**
@@ -691,13 +691,13 @@  discard block
 block discarded – undo
691 691
 
692 692
         foreach ($this->getGenerator() as $key => $item) {
693 693
             if ($item instanceof self) {
694
-                $result[$prefix . $key] = $item->appendToEachKey($prefix);
694
+                $result[$prefix.$key] = $item->appendToEachKey($prefix);
695 695
             } elseif (\is_array($item)) {
696
-                $result[$prefix . $key] = self::create($item, $this->iteratorClass, false)
696
+                $result[$prefix.$key] = self::create($item, $this->iteratorClass, false)
697 697
                     ->appendToEachKey($prefix)
698 698
                     ->toArray();
699 699
             } else {
700
-                $result[$prefix . $key] = $item;
700
+                $result[$prefix.$key] = $item;
701 701
             }
702 702
         }
703 703
 
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
             } elseif (\is_object($item)) {
726 726
                 $result[$key] = $item;
727 727
             } else {
728
-                $result[$key] = $prefix . $item;
728
+                $result[$key] = $prefix.$item;
729 729
             }
730 730
         }
731 731
 
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
     public function clean(): self
875 875
     {
876 876
         return $this->filter(
877
-            static function ($value) {
877
+            static function($value) {
878 878
                 return (bool) $value;
879 879
             }
880 880
         );
@@ -1228,7 +1228,7 @@  discard block
 block discarded – undo
1228 1228
         // trim all string in the array
1229 1229
         \array_walk(
1230 1230
             $array,
1231
-            static function (&$val) {
1231
+            static function(&$val) {
1232 1232
                 if (\is_string($val)) {
1233 1233
                     $val = \trim($val);
1234 1234
                 }
@@ -1617,40 +1617,40 @@  discard block
 block discarded – undo
1617 1617
         }
1618 1618
 
1619 1619
         $ops = [
1620
-            'eq' => static function ($item, $prop, $value) {
1620
+            'eq' => static function($item, $prop, $value) {
1621 1621
                 return $item[$prop] === $value;
1622 1622
             },
1623
-            'gt' => static function ($item, $prop, $value) {
1623
+            'gt' => static function($item, $prop, $value) {
1624 1624
                 return $item[$prop] > $value;
1625 1625
             },
1626
-            'ge' => static function ($item, $prop, $value) {
1626
+            'ge' => static function($item, $prop, $value) {
1627 1627
                 return $item[$prop] >= $value;
1628 1628
             },
1629
-            'gte' => static function ($item, $prop, $value) {
1629
+            'gte' => static function($item, $prop, $value) {
1630 1630
                 return $item[$prop] >= $value;
1631 1631
             },
1632
-            'lt' => static function ($item, $prop, $value) {
1632
+            'lt' => static function($item, $prop, $value) {
1633 1633
                 return $item[$prop] < $value;
1634 1634
             },
1635
-            'le' => static function ($item, $prop, $value) {
1635
+            'le' => static function($item, $prop, $value) {
1636 1636
                 return $item[$prop] <= $value;
1637 1637
             },
1638
-            'lte' => static function ($item, $prop, $value) {
1638
+            'lte' => static function($item, $prop, $value) {
1639 1639
                 return $item[$prop] <= $value;
1640 1640
             },
1641
-            'ne' => static function ($item, $prop, $value) {
1641
+            'ne' => static function($item, $prop, $value) {
1642 1642
                 return $item[$prop] !== $value;
1643 1643
             },
1644
-            'contains' => static function ($item, $prop, $value) {
1644
+            'contains' => static function($item, $prop, $value) {
1645 1645
                 return \in_array($item[$prop], (array) $value, true);
1646 1646
             },
1647
-            'notContains' => static function ($item, $prop, $value) {
1647
+            'notContains' => static function($item, $prop, $value) {
1648 1648
                 return !\in_array($item[$prop], (array) $value, true);
1649 1649
             },
1650
-            'newer' => static function ($item, $prop, $value) {
1650
+            'newer' => static function($item, $prop, $value) {
1651 1651
                 return \strtotime($item[$prop]) > \strtotime($value);
1652 1652
             },
1653
-            'older' => static function ($item, $prop, $value) {
1653
+            'older' => static function($item, $prop, $value) {
1654 1654
                 return \strtotime($item[$prop]) < \strtotime($value);
1655 1655
             },
1656 1656
         ];
@@ -1658,7 +1658,7 @@  discard block
 block discarded – undo
1658 1658
         $result = \array_values(
1659 1659
             \array_filter(
1660 1660
                 $this->getArray(),
1661
-                static function ($item) use (
1661
+                static function($item) use (
1662 1662
                     $property,
1663 1663
                     $value,
1664 1664
                     $ops,
@@ -2341,7 +2341,7 @@  discard block
 block discarded – undo
2341 2341
                 \array_uintersect(
2342 2342
                     $this->array,
2343 2343
                     $search,
2344
-                    static function ($a, $b) {
2344
+                    static function($a, $b) {
2345 2345
                         return $a === $b ? 0 : -1;
2346 2346
                     }
2347 2347
                 ),
@@ -2589,13 +2589,13 @@  discard block
 block discarded – undo
2589 2589
         // non recursive
2590 2590
 
2591 2591
         if ($search_values === null) {
2592
-            $arrayFunction = function () {
2592
+            $arrayFunction = function() {
2593 2593
                 foreach ($this->getGenerator() as $key => $value) {
2594 2594
                     yield $key;
2595 2595
                 }
2596 2596
             };
2597 2597
         } else {
2598
-            $arrayFunction = function () use ($search_values, $strict) {
2598
+            $arrayFunction = function() use ($search_values, $strict) {
2599 2599
                 $is_array_tmp = \is_array($search_values);
2600 2600
 
2601 2601
                 foreach ($this->getGenerator() as $key => $value) {
@@ -2795,7 +2795,7 @@  discard block
 block discarded – undo
2795 2795
         $useArguments = \func_num_args() > 2;
2796 2796
 
2797 2797
         return static::create(
2798
-            function () use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
2798
+            function() use ($useArguments, $callable, $useKeyAsSecondParameter, $arguments) {
2799 2799
                 foreach ($this->getGenerator() as $key => $value) {
2800 2800
                     if ($useArguments) {
2801 2801
                         if ($useKeyAsSecondParameter) {
@@ -3149,7 +3149,7 @@  discard block
 block discarded – undo
3149 3149
                 )->prependToEachKey($suffix)
3150 3150
                     ->toArray();
3151 3151
             } else {
3152
-                $result[$key . $suffix] = $item;
3152
+                $result[$key.$suffix] = $item;
3153 3153
             }
3154 3154
         }
3155 3155
 
@@ -3186,7 +3186,7 @@  discard block
 block discarded – undo
3186 3186
             } elseif (\is_object($item)) {
3187 3187
                 $result[$key] = $item;
3188 3188
             } else {
3189
-                $result[$key] = $item . $suffix;
3189
+                $result[$key] = $item.$suffix;
3190 3190
             }
3191 3191
         }
3192 3192
 
@@ -3775,7 +3775,7 @@  discard block
 block discarded – undo
3775 3775
     public function replaceValues($search, $replacement = ''): self
3776 3776
     {
3777 3777
         return $this->each(
3778
-            static function ($value) use ($search, $replacement) {
3778
+            static function($value) use ($search, $replacement) {
3779 3779
                 return \str_replace($search, $replacement, $value);
3780 3780
             }
3781 3781
         );
@@ -4273,7 +4273,7 @@  discard block
 block discarded – undo
4273 4273
             );
4274 4274
 
4275 4275
             $results = $arrayy->each(
4276
-                function ($value) use ($sorter) {
4276
+                function($value) use ($sorter) {
4277 4277
                     if (\is_callable($sorter)) {
4278 4278
                         return $sorter($value);
4279 4279
                     }
@@ -4335,7 +4335,7 @@  discard block
 block discarded – undo
4335 4335
     public function stripEmpty(): self
4336 4336
     {
4337 4337
         return $this->filter(
4338
-            static function ($item) {
4338
+            static function($item) {
4339 4339
                 if ($item === null) {
4340 4340
                     return false;
4341 4341
                 }
@@ -4419,7 +4419,7 @@  discard block
 block discarded – undo
4419 4419
         // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array
4420 4420
 
4421 4421
         $this->array = $this->reduce(
4422
-            static function ($resultArray, $value) {
4422
+            static function($resultArray, $value) {
4423 4423
                 if (!\in_array($value, $resultArray, true)) {
4424 4424
                     $resultArray[] = $value;
4425 4425
                 }
@@ -4448,7 +4448,7 @@  discard block
 block discarded – undo
4448 4448
 
4449 4449
         $this->array = \array_reduce(
4450 4450
             \array_keys($array),
4451
-            static function ($resultArray, $key) use ($array) {
4451
+            static function($resultArray, $key) use ($array) {
4452 4452
                 if (!\in_array($array[$key], $resultArray, true)) {
4453 4453
                     $resultArray[$key] = $array[$key];
4454 4454
                 }
@@ -4508,7 +4508,7 @@  discard block
 block discarded – undo
4508 4508
     public function values(): self
4509 4509
     {
4510 4510
         return static::create(
4511
-            function () {
4511
+            function() {
4512 4512
                 /** @noinspection YieldFromCanBeUsedInspection */
4513 4513
                 foreach ($this->getGenerator() as $value) {
4514 4514
                     yield $value;
@@ -4941,7 +4941,7 @@  discard block
 block discarded – undo
4941 4941
             $this->properties !== []
4942 4942
         ) {
4943 4943
             if (isset($this->properties[$key]) === false) {
4944
-                throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').');
4944
+                throw new \InvalidArgumentException('The key '.$key.' does not exists as @property in the class ('.\get_class($this).').');
4945 4945
             }
4946 4946
 
4947 4947
             $this->properties[$key]->checkType($value);
@@ -5093,7 +5093,7 @@  discard block
 block discarded – undo
5093 5093
     private function getPropertiesFromPhpDoc(): array
5094 5094
     {
5095 5095
         static $PROPERTY_CACHE = [];
5096
-        $cacheKey = 'Class::' . static::class;
5096
+        $cacheKey = 'Class::'.static::class;
5097 5097
 
5098 5098
         if (isset($PROPERTY_CACHE[$cacheKey])) {
5099 5099
             return $PROPERTY_CACHE[$cacheKey];
Please login to merge, or discard this patch.