Completed
Push — master ( 20b6b5...679ccf )
by Lars
07:17 queued 02:49
created
src/Arrayy.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -96,12 +96,12 @@  discard block
 block discarded – undo
96 96
             &&
97 97
             \count(\array_diff_key($this->properties, $array)) > 0
98 98
         ) {
99
-            throw new \InvalidArgumentException('Property mismatch - input: ' . \print_r(\array_keys($array), true) . ' | expected: ' . \print_r(\array_keys($this->properties), true));
99
+            throw new \InvalidArgumentException('Property mismatch - input: '.\print_r(\array_keys($array), true).' | expected: '.\print_r(\array_keys($this->properties), true));
100 100
         }
101 101
 
102 102
         \array_walk(
103 103
             $array,
104
-            function (&$value, &$key) {
104
+            function(&$value, &$key) {
105 105
                 $this->internalSet($key, $value);
106 106
             }
107 107
         );
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 
426 426
             $this->callAtPath(
427 427
                 $containerPath,
428
-                function ($container) use ($lastOffset, &$offsetExists) {
428
+                function($container) use ($lastOffset, &$offsetExists) {
429 429
                     $offsetExists = \array_key_exists($lastOffset, $container);
430 430
                 }
431 431
             );
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 
486 486
             $this->callAtPath(
487 487
                 \implode($this->pathSeparator, $path),
488
-                function (&$offset) use ($pathToUnset) {
488
+                function(&$offset) use ($pathToUnset) {
489 489
                     unset($offset[$pathToUnset]);
490 490
                 }
491 491
             );
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
         }
523 523
 
524 524
         if (\strpos($class, '\\') === 0) {
525
-            $class = '\\' . $class;
525
+            $class = '\\'.$class;
526 526
             if (\class_exists($class)) {
527 527
                 $this->iteratorClass = $class;
528 528
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
             }
531 531
         }
532 532
 
533
-        throw new \InvalidArgumentException('The iterator class does not exist: ' . $class);
533
+        throw new \InvalidArgumentException('The iterator class does not exist: '.$class);
534 534
     }
535 535
 
536 536
     /**
@@ -634,13 +634,13 @@  discard block
 block discarded – undo
634 634
 
635 635
         foreach ($this->getGenerator() as $key => $item) {
636 636
             if ($item instanceof self) {
637
-                $result[$prefix . $key] = $item->appendToEachKey($prefix);
637
+                $result[$prefix.$key] = $item->appendToEachKey($prefix);
638 638
             } elseif (\is_array($item)) {
639
-                $result[$prefix . $key] = self::create($item, $this->iteratorClass, false)
639
+                $result[$prefix.$key] = self::create($item, $this->iteratorClass, false)
640 640
                                               ->appendToEachKey($prefix)
641 641
                                               ->toArray();
642 642
             } else {
643
-                $result[$prefix . $key] = $item;
643
+                $result[$prefix.$key] = $item;
644 644
             }
645 645
         }
646 646
 
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
             } elseif (\is_object($item)) {
669 669
                 $result[$key] = $item;
670 670
             } else {
671
-                $result[$key] = $prefix . $item;
671
+                $result[$key] = $prefix.$item;
672 672
             }
673 673
         }
674 674
 
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
     public function clean()
921 921
     {
922 922
         return $this->filter(
923
-            function ($value) {
923
+            function($value) {
924 924
                 return (bool) $value;
925 925
             }
926 926
         );
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
             return $this->in_array_recursive(
973 973
                 \mb_strtoupper((string) $value),
974 974
                 $this->walk(
975
-                    function (&$val) {
975
+                    function(&$val) {
976 976
                         /** @noinspection PhpComposerExtensionStubsInspection */
977 977
                         $val = \mb_strtoupper((string) $val);
978 978
                     },
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
         return \in_array(
987 987
             \mb_strtoupper((string) $value),
988 988
             $this->walk(
989
-                function (&$val) {
989
+                function(&$val) {
990 990
                     /** @noinspection PhpComposerExtensionStubsInspection */
991 991
                     $val = \mb_strtoupper((string) $val);
992 992
                 },
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
         // trim all string in the array
1248 1248
         \array_walk(
1249 1249
             $array,
1250
-            function (&$val) {
1250
+            function(&$val) {
1251 1251
                 /** @noinspection ReferenceMismatchInspection */
1252 1252
                 if (\is_string($val)) {
1253 1253
                     $val = \trim($val);
@@ -1616,40 +1616,40 @@  discard block
 block discarded – undo
1616 1616
         }
1617 1617
 
1618 1618
         $ops = [
1619
-            'eq' => function ($item, $prop, $value) {
1619
+            'eq' => function($item, $prop, $value) {
1620 1620
                 return $item[$prop] === $value;
1621 1621
             },
1622
-            'gt' => function ($item, $prop, $value) {
1622
+            'gt' => function($item, $prop, $value) {
1623 1623
                 return $item[$prop] > $value;
1624 1624
             },
1625
-            'ge' => function ($item, $prop, $value) {
1625
+            'ge' => function($item, $prop, $value) {
1626 1626
                 return $item[$prop] >= $value;
1627 1627
             },
1628
-            'gte' => function ($item, $prop, $value) {
1628
+            'gte' => function($item, $prop, $value) {
1629 1629
                 return $item[$prop] >= $value;
1630 1630
             },
1631
-            'lt' => function ($item, $prop, $value) {
1631
+            'lt' => function($item, $prop, $value) {
1632 1632
                 return $item[$prop] < $value;
1633 1633
             },
1634
-            'le' => function ($item, $prop, $value) {
1634
+            'le' => function($item, $prop, $value) {
1635 1635
                 return $item[$prop] <= $value;
1636 1636
             },
1637
-            'lte' => function ($item, $prop, $value) {
1637
+            'lte' => function($item, $prop, $value) {
1638 1638
                 return $item[$prop] <= $value;
1639 1639
             },
1640
-            'ne' => function ($item, $prop, $value) {
1640
+            'ne' => function($item, $prop, $value) {
1641 1641
                 return $item[$prop] !== $value;
1642 1642
             },
1643
-            'contains' => function ($item, $prop, $value) {
1643
+            'contains' => function($item, $prop, $value) {
1644 1644
                 return \in_array($item[$prop], (array) $value, true);
1645 1645
             },
1646
-            'notContains' => function ($item, $prop, $value) {
1646
+            'notContains' => function($item, $prop, $value) {
1647 1647
                 return !\in_array($item[$prop], (array) $value, true);
1648 1648
             },
1649
-            'newer' => function ($item, $prop, $value) {
1649
+            'newer' => function($item, $prop, $value) {
1650 1650
                 return \strtotime($item[$prop]) > \strtotime($value);
1651 1651
             },
1652
-            'older' => function ($item, $prop, $value) {
1652
+            'older' => function($item, $prop, $value) {
1653 1653
                 return \strtotime($item[$prop]) < \strtotime($value);
1654 1654
             },
1655 1655
         ];
@@ -1657,7 +1657,7 @@  discard block
 block discarded – undo
1657 1657
         $result = \array_values(
1658 1658
             \array_filter(
1659 1659
                 (array) $this->array,
1660
-                function ($item) use (
1660
+                function($item) use (
1661 1661
                     $property,
1662 1662
                     $value,
1663 1663
                     $ops,
@@ -1943,7 +1943,7 @@  discard block
 block discarded – undo
1943 1943
     protected function getPublicProperties(): array
1944 1944
     {
1945 1945
         static $PROPERTY_CACHE = [];
1946
-        $cacheKey = 'Class::' . static::class;
1946
+        $cacheKey = 'Class::'.static::class;
1947 1947
 
1948 1948
         if (isset($PROPERTY_CACHE[$cacheKey])) {
1949 1949
             return $PROPERTY_CACHE[$cacheKey];
@@ -2309,7 +2309,7 @@  discard block
 block discarded – undo
2309 2309
     {
2310 2310
         if ($this->checkPropertyTypes === true) {
2311 2311
             if (isset($this->properties[$key]) === false) {
2312
-                throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').');
2312
+                throw new \InvalidArgumentException('The key '.$key.' does not exists as @property in the class ('.\get_class($this).').');
2313 2313
             }
2314 2314
 
2315 2315
             $this->properties[$key]->checkType($value);
@@ -2998,7 +2998,7 @@  discard block
 block discarded – undo
2998 2998
             } elseif (\is_array($item)) {
2999 2999
                 $result[$key] = self::create($item, $this->iteratorClass, false)->prependToEachKey($suffix)->toArray();
3000 3000
             } else {
3001
-                $result[$key . $suffix] = $item;
3001
+                $result[$key.$suffix] = $item;
3002 3002
             }
3003 3003
         }
3004 3004
 
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
             } elseif (\is_object($item)) {
3029 3029
                 $result[$key] = $item;
3030 3030
             } else {
3031
-                $result[$key] = $item . $suffix;
3031
+                $result[$key] = $item.$suffix;
3032 3032
             }
3033 3033
         }
3034 3034
 
@@ -3468,7 +3468,7 @@  discard block
 block discarded – undo
3468 3468
     public function replaceValues($search, $replacement = '')
3469 3469
     {
3470 3470
         $array = $this->each(
3471
-            function ($value) use ($search, $replacement) {
3471
+            function($value) use ($search, $replacement) {
3472 3472
                 return \str_replace($search, $replacement, $value);
3473 3473
             }
3474 3474
         );
@@ -3824,7 +3824,7 @@  discard block
 block discarded – undo
3824 3824
 
3825 3825
             $that = $this;
3826 3826
             $results = $arrayy->each(
3827
-                function ($value) use ($sorter, $that) {
3827
+                function($value) use ($sorter, $that) {
3828 3828
                     return \is_callable($sorter) ? $sorter($value) : $that->get($sorter, null, $value);
3829 3829
                 }
3830 3830
             );
@@ -3943,7 +3943,7 @@  discard block
 block discarded – undo
3943 3943
     public function stripEmpty()
3944 3944
     {
3945 3945
         return $this->filter(
3946
-            function ($item) {
3946
+            function($item) {
3947 3947
                 if ($item === null) {
3948 3948
                     return false;
3949 3949
                 }
@@ -4020,7 +4020,7 @@  discard block
 block discarded – undo
4020 4020
 
4021 4021
         $this->array = \array_reduce(
4022 4022
             $this->array,
4023
-            function ($resultArray, $value) {
4023
+            function($resultArray, $value) {
4024 4024
                 if (!\in_array($value, $resultArray, true)) {
4025 4025
                     $resultArray[] = $value;
4026 4026
                 }
@@ -4054,7 +4054,7 @@  discard block
 block discarded – undo
4054 4054
 
4055 4055
         $this->array = \array_reduce(
4056 4056
             \array_keys($array),
4057
-            function ($resultArray, $key) use ($array) {
4057
+            function($resultArray, $key) use ($array) {
4058 4058
                 if (!\in_array($array[$key], $resultArray, true)) {
4059 4059
                     $resultArray[$key] = $array[$key];
4060 4060
                 }
Please login to merge, or discard this patch.