Completed
Push — master ( bc3add...2f3f1a )
by Lars
12:22
created
src/StaticArrayy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     }
42 42
 
43 43
     if (!isset(static::$methodArgs[$name])) {
44
-      throw new \BadMethodCallException($name . ' is not a valid method');
44
+      throw new \BadMethodCallException($name.' is not a valid method');
45 45
     }
46 46
 
47 47
     $numArgs = count($arguments);
Please login to merge, or discard this patch.
src/Arrayy.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
   }
322 322
 
323 323
   /**
324
-   * @param mixed      $path
324
+   * @param string      $path
325 325
    * @param callable   $callback
326 326
    * @param null|array $currentOffset
327 327
    */
@@ -2461,7 +2461,7 @@  discard block
 block discarded – undo
2461 2461
 
2462 2462
   /**
2463 2463
    * @param array      &$elements
2464
-   * @param int|string $direction
2464
+   * @param integer $direction
2465 2465
    * @param int        $strategy
2466 2466
    * @param bool       $keepKeys
2467 2467
    */
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
       }
67 67
     }
68 68
 
69
-    return (array)$this->array;
69
+    return (array) $this->array;
70 70
   }
71 71
 
72 72
   /**
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
       $this->callAtPath(
198 198
           $containerPath,
199
-          function ($container) use ($lastOffset, &$offsetExists) {
199
+          function($container) use ($lastOffset, &$offsetExists) {
200 200
             $offsetExists = isset($container[$lastOffset]);
201 201
           }
202 202
       );
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 
251 251
     $this->callAtPath(
252 252
         implode($this->pathSeparator, $path),
253
-        function (&$offset) use (&$pathToUnset) {
253
+        function(&$offset) use (&$pathToUnset) {
254 254
           unset($offset[$pathToUnset]);
255 255
         }
256 256
     );
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
   public function clean()
389 389
   {
390 390
     return $this->filter(
391
-        function ($value) {
392
-          return (bool)$value;
391
+        function($value) {
392
+          return (bool) $value;
393 393
         }
394 394
     );
395 395
   }
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
     // trim all string in the array
576 576
     array_walk(
577 577
         $array,
578
-        function (&$val) {
578
+        function(&$val) {
579 579
           /** @noinspection ReferenceMismatchInspection */
580 580
           if (is_string($val)) {
581 581
             $val = trim($val);
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
     }
789 789
 
790 790
     if (is_object($array) && method_exists($array, '__toArray')) {
791
-      return (array)$array->__toArray();
791
+      return (array) $array->__toArray();
792 792
     }
793 793
 
794 794
     /** @noinspection ReferenceMismatchInspection */
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
         ||
798 798
         (is_object($array) && method_exists($array, '__toString'))
799 799
     ) {
800
-      return (array)$array;
800
+      return (array) $array;
801 801
     }
802 802
 
803 803
     throw new \InvalidArgumentException(
@@ -850,54 +850,54 @@  discard block
 block discarded – undo
850 850
     }
851 851
 
852 852
     $ops = array(
853
-        'eq'          => function ($item, $prop, $value) {
853
+        'eq'          => function($item, $prop, $value) {
854 854
           return $item[$prop] === $value;
855 855
         },
856
-        'gt'          => function ($item, $prop, $value) {
856
+        'gt'          => function($item, $prop, $value) {
857 857
           return $item[$prop] > $value;
858 858
         },
859
-        'ge'          => function ($item, $prop, $value) {
859
+        'ge'          => function($item, $prop, $value) {
860 860
           return $item[$prop] >= $value;
861 861
         },
862
-        'gte'         => function ($item, $prop, $value) {
862
+        'gte'         => function($item, $prop, $value) {
863 863
           return $item[$prop] >= $value;
864 864
         },
865
-        'lt'          => function ($item, $prop, $value) {
865
+        'lt'          => function($item, $prop, $value) {
866 866
           return $item[$prop] < $value;
867 867
         },
868
-        'le'          => function ($item, $prop, $value) {
868
+        'le'          => function($item, $prop, $value) {
869 869
           return $item[$prop] <= $value;
870 870
         },
871
-        'lte'         => function ($item, $prop, $value) {
871
+        'lte'         => function($item, $prop, $value) {
872 872
           return $item[$prop] <= $value;
873 873
         },
874
-        'ne'          => function ($item, $prop, $value) {
874
+        'ne'          => function($item, $prop, $value) {
875 875
           return $item[$prop] !== $value;
876 876
         },
877
-        'contains'    => function ($item, $prop, $value) {
878
-          return in_array($item[$prop], (array)$value, true);
877
+        'contains'    => function($item, $prop, $value) {
878
+          return in_array($item[$prop], (array) $value, true);
879 879
         },
880
-        'notContains' => function ($item, $prop, $value) {
881
-          return !in_array($item[$prop], (array)$value, true);
880
+        'notContains' => function($item, $prop, $value) {
881
+          return !in_array($item[$prop], (array) $value, true);
882 882
         },
883
-        'newer'       => function ($item, $prop, $value) {
883
+        'newer'       => function($item, $prop, $value) {
884 884
           return strtotime($item[$prop]) > strtotime($value);
885 885
         },
886
-        'older'       => function ($item, $prop, $value) {
886
+        'older'       => function($item, $prop, $value) {
887 887
           return strtotime($item[$prop]) < strtotime($value);
888 888
         },
889 889
     );
890 890
 
891 891
     $result = array_values(
892 892
         array_filter(
893
-            (array)$this->array,
894
-            function ($item) use (
893
+            (array) $this->array,
894
+            function($item) use (
895 895
                 $property,
896 896
                 $value,
897 897
                 $ops,
898 898
                 $comparisonOp
899 899
             ) {
900
-              $item = (array)$item;
900
+              $item = (array) $item;
901 901
               $itemArrayy = new Arrayy($item);
902 902
               $item[$property] = $itemArrayy->get($property, array());
903 903
 
@@ -968,9 +968,9 @@  discard block
 block discarded – undo
968 968
   public function firstsImmutable($number = null)
969 969
   {
970 970
     if ($number === null) {
971
-      $array = (array)array_shift($this->array);
971
+      $array = (array) array_shift($this->array);
972 972
     } else {
973
-      $number = (int)$number;
973
+      $number = (int) $number;
974 974
       $array = array_splice($this->array, 0, $number, true);
975 975
     }
976 976
 
@@ -987,9 +987,9 @@  discard block
 block discarded – undo
987 987
   public function firstsMutable($number = null)
988 988
   {
989 989
     if ($number === null) {
990
-      $this->array = (array)array_shift($this->array);
990
+      $this->array = (array) array_shift($this->array);
991 991
     } else {
992
-      $number = (int)$number;
992
+      $number = (int) $number;
993 993
       $this->array = array_splice($this->array, 0, $number, true);
994 994
     }
995 995
 
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
    */
1191 1191
   public function group($grouper, $saveKeys = false)
1192 1192
   {
1193
-    $array = (array)$this->array;
1193
+    $array = (array) $this->array;
1194 1194
     $result = array();
1195 1195
 
1196 1196
     // Iterate over values, group by property/results from closure
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
   public function has($key)
1225 1225
   {
1226 1226
     // Generate unique string to use as marker.
1227
-    $unFound = (string)uniqid('arrayy', true);
1227
+    $unFound = (string) uniqid('arrayy', true);
1228 1228
 
1229 1229
     return $this->get($key, $unFound) !== $unFound;
1230 1230
   }
@@ -1524,10 +1524,10 @@  discard block
 block discarded – undo
1524 1524
   public function lastsImmutable($number = null)
1525 1525
   {
1526 1526
     if ($number === null) {
1527
-      $poppedValue = (array)$this->pop();
1527
+      $poppedValue = (array) $this->pop();
1528 1528
       $arrayy = static::create($poppedValue);
1529 1529
     } else {
1530
-      $number = (int)$number;
1530
+      $number = (int) $number;
1531 1531
       $arrayy = $this->rest(-$number);
1532 1532
     }
1533 1533
 
@@ -1544,10 +1544,10 @@  discard block
 block discarded – undo
1544 1544
   public function lastsMutable($number = null)
1545 1545
   {
1546 1546
     if ($number === null) {
1547
-      $poppedValue = (array)$this->pop();
1547
+      $poppedValue = (array) $this->pop();
1548 1548
       $this->array = static::create($poppedValue)->array;
1549 1549
     } else {
1550
-      $number = (int)$number;
1550
+      $number = (int) $number;
1551 1551
       $this->array = $this->rest(-$number)->array;
1552 1552
     }
1553 1553
 
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
     }
1830 1830
 
1831 1831
     if ($number === null) {
1832
-      $arrayRandValue = (array)$this->array[array_rand($this->array)];
1832
+      $arrayRandValue = (array) $this->array[array_rand($this->array)];
1833 1833
 
1834 1834
       return static::create($arrayRandValue);
1835 1835
     }
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
    */
1871 1871
   public function randomKeys($number)
1872 1872
   {
1873
-    $number = (int)$number;
1873
+    $number = (int) $number;
1874 1874
     $count = $this->count();
1875 1875
 
1876 1876
     if ($number === 0 || $number > $count) {
@@ -1883,7 +1883,7 @@  discard block
 block discarded – undo
1883 1883
       );
1884 1884
     }
1885 1885
 
1886
-    $result = (array)array_rand($this->array, $number);
1886
+    $result = (array) array_rand($this->array, $number);
1887 1887
 
1888 1888
     return static::create($result);
1889 1889
   }
@@ -1902,7 +1902,7 @@  discard block
 block discarded – undo
1902 1902
     }
1903 1903
 
1904 1904
     if ($number === null) {
1905
-      $arrayRandValue = (array)$this->array[array_rand($this->array)];
1905
+      $arrayRandValue = (array) $this->array[array_rand($this->array)];
1906 1906
       $this->array = $arrayRandValue;
1907 1907
 
1908 1908
       return $this;
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
    */
1939 1939
   public function randomValues($number)
1940 1940
   {
1941
-    $number = (int)$number;
1941
+    $number = (int) $number;
1942 1942
 
1943 1943
     return $this->randomMutable($number);
1944 1944
   }
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
     if ($result === null) {
1983 1983
       $this->array = array();
1984 1984
     } else {
1985
-      $this->array = (array)$result;
1985
+      $this->array = (array) $result;
1986 1986
     }
1987 1987
 
1988 1988
     return static::create($this->array);
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
   public function replaceValues($search, $replacement = '')
2184 2184
   {
2185 2185
     $array = $this->each(
2186
-        function ($value) use ($search, $replacement) {
2186
+        function($value) use ($search, $replacement) {
2187 2187
           return UTF8::str_replace($search, $replacement, $value);
2188 2188
         }
2189 2189
     );
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
    */
2412 2412
   public function sorter($sorter = null, $direction = SORT_ASC, $strategy = SORT_REGULAR)
2413 2413
   {
2414
-    $array = (array)$this->array;
2414
+    $array = (array) $this->array;
2415 2415
     $direction = $this->getDirection($direction);
2416 2416
 
2417 2417
     // Transform all values into their results.
@@ -2420,7 +2420,7 @@  discard block
 block discarded – undo
2420 2420
 
2421 2421
       $that = $this;
2422 2422
       $results = $arrayy->each(
2423
-          function ($value) use ($sorter, $that) {
2423
+          function($value) use ($sorter, $that) {
2424 2424
             return is_callable($sorter) ? $sorter($value) : $that->get($sorter, null, $value);
2425 2425
           }
2426 2426
       );
@@ -2508,7 +2508,7 @@  discard block
 block discarded – undo
2508 2508
     if ($arrayCount === 0) {
2509 2509
       $result = array();
2510 2510
     } else {
2511
-      $numberOfPieces = (int)$numberOfPieces;
2511
+      $numberOfPieces = (int) $numberOfPieces;
2512 2512
       $splitSize = ceil($arrayCount / $numberOfPieces);
2513 2513
       $result = array_chunk($this->array, $splitSize, $keepKeys);
2514 2514
     }
@@ -2524,12 +2524,12 @@  discard block
 block discarded – undo
2524 2524
   public function stripEmpty()
2525 2525
   {
2526 2526
     return $this->filter(
2527
-        function ($item) {
2527
+        function($item) {
2528 2528
           if (null === $item) {
2529 2529
             return false;
2530 2530
           }
2531 2531
 
2532
-          return (bool)trim($item);
2532
+          return (bool) trim($item);
2533 2533
         }
2534 2534
     );
2535 2535
   }
@@ -2594,7 +2594,7 @@  discard block
 block discarded – undo
2594 2594
   {
2595 2595
     $this->array = array_reduce(
2596 2596
         $this->array,
2597
-        function ($resultArray, $value) {
2597
+        function($resultArray, $value) {
2598 2598
           if (in_array($value, $resultArray, true) === false) {
2599 2599
             $resultArray[] = $value;
2600 2600
           }
@@ -2607,7 +2607,7 @@  discard block
 block discarded – undo
2607 2607
     if ($this->array === null) {
2608 2608
       $this->array = array();
2609 2609
     } else {
2610
-      $this->array = (array)$this->array;
2610
+      $this->array = (array) $this->array;
2611 2611
     }
2612 2612
 
2613 2613
     return $this;
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
    */
2636 2636
   public function values()
2637 2637
   {
2638
-    return static::create(array_values((array)$this->array));
2638
+    return static::create(array_values((array) $this->array));
2639 2639
   }
2640 2640
 
2641 2641
   /**
Please login to merge, or discard this patch.