Passed
Pull Request — master (#28)
by
unknown
02:45
created
src/Zicht/Itertools/lib/GroupbyIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@
 block discarded – undo
160 160
         $array = iterator_to_array($this);
161 161
         array_walk(
162 162
             $array,
163
-            function (&$value) {
163
+            function(&$value) {
164 164
                 /** @var GroupedIterator $value */
165 165
                 $value = $value->toArray();
166 166
             }
Please login to merge, or discard this patch.
src/Zicht/Itertools/util/Mappings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public static function lstrip($chars = " \t\n\r\0\x0B")
18 18
     {
19
-        return function ($value) use ($chars) {
19
+        return function($value) use ($chars) {
20 20
             return ltrim($value, $chars);
21 21
         };
22 22
     }
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public static function rstrip($chars = " \t\n\r\0\x0B")
28 28
     {
29
-        return function ($value) use ($chars) {
29
+        return function($value) use ($chars) {
30 30
             return rtrim($value, $chars);
31 31
         };
32 32
     }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public static function strip($chars = " \t\n\r\0\x0B")
38 38
     {
39
-        return function ($value) use ($chars) {
39
+        return function($value) use ($chars) {
40 40
             return trim($value, $chars);
41 41
         };
42 42
     }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public static function length()
48 48
     {
49
-        return function ($value) {
49
+        return function($value) {
50 50
             return sizeof($value);
51 51
         };
52 52
     }
Please login to merge, or discard this patch.
src/Zicht/Itertools/reductions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function add()
17 17
 {
18
-    return function ($a, $b) {
18
+    return function($a, $b) {
19 19
         if (!is_numeric($a)) {
20 20
             throw new \InvalidArgumentException('Argument $A must be numeric to perform addition');
21 21
         }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  */
34 34
 function sub()
35 35
 {
36
-    return function ($a, $b) {
36
+    return function($a, $b) {
37 37
         if (!is_numeric($a)) {
38 38
             throw new \InvalidArgumentException('Argument $A must be numeric to perform subtraction');
39 39
         }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
  */
52 52
 function mul()
53 53
 {
54
-    return function ($a, $b) {
54
+    return function($a, $b) {
55 55
         if (!is_numeric($a)) {
56 56
             throw new \InvalidArgumentException('Argument $A must be numeric to perform multiplication');
57 57
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
  */
70 70
 function min()
71 71
 {
72
-    return function ($a, $b) {
72
+    return function($a, $b) {
73 73
         if (!is_numeric($a)) {
74 74
             throw new \InvalidArgumentException('Argument $A must be numeric to determine minimum');
75 75
         }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
  */
88 88
 function max()
89 89
 {
90
-    return function ($a, $b) {
90
+    return function($a, $b) {
91 91
         if (!is_numeric($a)) {
92 92
             throw new \InvalidArgumentException('Argument $A must be numeric to determine maximum');
93 93
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     if (!is_string($glue)) {
110 110
         throw new \InvalidArgumentException('Argument $GLUE must be a string to join');
111 111
     }
112
-    return function ($a, $b) use ($glue) {
112
+    return function($a, $b) use ($glue) {
113 113
         if (!is_string($a)) {
114 114
             throw new \InvalidArgumentException('Argument $A must be a string to join');
115 115
         }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function chain()
133 133
 {
134
-    return function ($chainIterator, $b) {
134
+    return function($chainIterator, $b) {
135 135
         if (!($chainIterator instanceof ChainIterator)) {
136 136
             throw new \InvalidArgumentException('Argument $A must be a ChainIterator.  Did your call "reduce" with "new ChainIterator()" as the initial parameter?');
137 137
         }
Please login to merge, or discard this patch.
src/Zicht/Itertools/mappings.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function lstrip($chars = " \t\n\r\0\x0B")
18 18
 {
19
-    return function ($value) use ($chars) {
19
+    return function($value) use ($chars) {
20 20
         return ltrim($value, $chars);
21 21
     };
22 22
 }
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  */
30 30
 function rstrip($chars = " \t\n\r\0\x0B")
31 31
 {
32
-    return function ($value) use ($chars) {
32
+    return function($value) use ($chars) {
33 33
         return rtrim($value, $chars);
34 34
     };
35 35
 }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
  */
43 43
 function strip($chars = " \t\n\r\0\x0B")
44 44
 {
45
-    return function ($value) use ($chars) {
45
+    return function($value) use ($chars) {
46 46
         return trim($value, $chars);
47 47
     };
48 48
 }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  */
55 55
 function length()
56 56
 {
57
-    return function ($value) {
57
+    return function($value) {
58 58
         if (is_null($value)) {
59 59
             return 0;
60 60
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
  */
75 75
 function key()
76 76
 {
77
-    return function ($value, $key) {
77
+    return function($value, $key) {
78 78
         return $key;
79 79
     };
80 80
 }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  */
87 87
 function lower()
88 88
 {
89
-    return function ($value) {
89
+    return function($value) {
90 90
         return strtolower($value);
91 91
     };
92 92
 }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
  */
99 99
 function upper()
100 100
 {
101
-    return function ($value) {
101
+    return function($value) {
102 102
         return strtoupper($value);
103 103
     };
104 104
 }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 {
135 135
     $strategies = array_map('\Zicht\Itertools\conversions\mixed_to_value_getter', $strategies);
136 136
 
137
-    return function ($value, $key) use ($strategies) {
137
+    return function($value, $key) use ($strategies) {
138 138
         $res = [];
139 139
         foreach ($strategies as $strategyKey => $strategy) {
140 140
             $res[$strategyKey] = $strategy($value, $key);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         $max = getrandmax();
157 157
     }
158 158
 
159
-    return function () use ($min, $max) {
159
+    return function() use ($min, $max) {
160 160
         return rand($min, $max);
161 161
     };
162 162
 }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 function type($strategy = null)
171 171
 {
172 172
     $strategy = conversions\mixed_to_value_getter($strategy);
173
-    return function ($value) use ($strategy) {
173
+    return function($value) use ($strategy) {
174 174
         $value = $strategy($value);
175 175
         return is_object($value) ? get_class($value) : gettype($value);
176 176
     };
Please login to merge, or discard this patch.
src/Zicht/Itertools/itertools.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     // http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list
175 175
 
176 176
     $iterables = array_map(
177
-        function ($iterable) {
177
+        function($iterable) {
178 178
             return conversions\mixed_to_iterator($iterable);
179 179
         },
180 180
         func_get_args()
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
     // http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list
328 328
 
329 329
     $iterables = array_map(
330
-        function ($iterable) {
330
+        function($iterable) {
331 331
             return conversions\mixed_to_iterator($iterable);
332 332
         },
333 333
         array_slice(func_get_args(), 1)
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
     }
526 526
 
527 527
     $strategy = conversions\mixed_to_value_getter($strategy);
528
-    $isValid = function ($value, $key) use ($strategy) {
528
+    $isValid = function($value, $key) use ($strategy) {
529 529
         $tempVarPhp54 = $strategy($value, $key);
530 530
         return !empty($tempVarPhp54);
531 531
     };
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
     switch (sizeof($args)) {
563 563
         case 2:
564 564
             $strategy = conversions\mixed_to_value_getter($args[0]);
565
-            $closure = function ($value, $key) use ($strategy) {
565
+            $closure = function($value, $key) use ($strategy) {
566 566
                 $tempVarPhp54 = call_user_func($strategy, $value, $key);
567 567
                 return !empty($tempVarPhp54);
568 568
             };
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
         case 3:
573 573
             $strategy = conversions\mixed_to_value_getter($args[0]);
574 574
             $userClosure = $args[1];
575
-            $closure = function ($value, $key) use ($strategy, $userClosure) {
575
+            $closure = function($value, $key) use ($strategy, $userClosure) {
576 576
                 return call_user_func($userClosure, call_user_func($strategy, $value, $key));
577 577
             };
578 578
             $iterable = conversions\mixed_to_iterator($args[2]);
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
     // http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list
608 608
 
609 609
     $iterables = array_map(
610
-        function ($iterable) {
610
+        function($iterable) {
611 611
             return conversions\mixed_to_iterator($iterable);
612 612
         },
613 613
         func_get_args()
Please login to merge, or discard this patch.
src/Zicht/Itertools/filters.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 function type($class, $strategy = null)
29 29
 {
30 30
     $strategy = conversions\mixed_to_value_getter($strategy);
31
-    return function ($value, $key = null) use ($class, $strategy) {
31
+    return function($value, $key = null) use ($class, $strategy) {
32 32
         return $strategy($value, $key) instanceof $class;
33 33
     };
34 34
 }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $haystack = iter\iterable($haystack)->values();
59 59
     }
60 60
     $strategy = conversions\mixed_to_value_getter($strategy);
61
-    return function ($value, $key = null) use ($haystack, $strategy, $strict) {
61
+    return function($value, $key = null) use ($haystack, $strategy, $strict) {
62 62
         return in_array($strategy($value, $key), $haystack, $strict);
63 63
     };
64 64
 }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $haystack = iter\iterable($haystack)->values();
81 81
     }
82 82
     $strategy = conversions\mixed_to_value_getter($strategy);
83
-    return function ($value, $key = null) use ($haystack, $strategy, $strict) {
83
+    return function($value, $key = null) use ($haystack, $strategy, $strict) {
84 84
         return !in_array($strategy($value, $key), $haystack, $strict);
85 85
     };
86 86
 }
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
     }
109 109
     $strategy = conversions\mixed_to_value_getter($strategy);
110 110
     if ($strict) {
111
-        return function ($value, $key = null) use ($expected, $strategy) {
111
+        return function($value, $key = null) use ($expected, $strategy) {
112 112
             return $expected === $strategy($value, $key);
113 113
         };
114 114
     } else {
115
-        return function ($value, $key = null) use ($expected, $strategy) {
115
+        return function($value, $key = null) use ($expected, $strategy) {
116 116
             return $expected == $strategy($value, $key);
117 117
         };
118 118
     }
Please login to merge, or discard this patch.
src/Zicht/Itertools/lib/ZipIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
      */
68 68
     public function __construct()
69 69
     {
70
-        parent::__construct(\MultipleIterator::MIT_NEED_ALL | \MultipleIterator::MIT_KEYS_NUMERIC);
70
+        parent::__construct(\MultipleIterator::MIT_NEED_ALL|\MultipleIterator::MIT_KEYS_NUMERIC);
71 71
         foreach (func_get_args() as $iterable) {
72 72
             if (!$iterable instanceof \Iterator) {
73 73
                 throw new \InvalidArgumentException(sprintf('Not all arguments are iterators'));
Please login to merge, or discard this patch.
src/Zicht/Itertools/lib/SortedIterator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,13 +73,13 @@
 block discarded – undo
73 73
     public function __construct(\Closure $func, \Iterator $iterable, $reverse = false)
74 74
     {
75 75
         if ($reverse) {
76
-            $cmp = function ($a, $b) use ($func) {
76
+            $cmp = function($a, $b) use ($func) {
77 77
                 $orderA = $a['order'];
78 78
                 $orderB = $b['order'];
79 79
                 return $orderA == $orderB ? 0 : ($orderA < $orderB ? 1 : -1);
80 80
             };
81 81
         } else {
82
-            $cmp = function ($a, $b) use ($func) {
82
+            $cmp = function($a, $b) use ($func) {
83 83
                 $orderA = $a['order'];
84 84
                 $orderB = $b['order'];
85 85
                 return $orderA == $orderB ? 0 : ($orderA < $orderB ? -1 : 1);
Please login to merge, or discard this patch.
src/Zicht/Itertools/lib/MapIterator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function __construct(\Closure $valueFunc /* [\Closure $keyFunc], \Iterator $iterable1, [\Iterator $iterable2, [...]] */)
80 80
     {
81
-        parent::__construct(\MultipleIterator::MIT_NEED_ALL | \MultipleIterator::MIT_KEYS_NUMERIC);
81
+        parent::__construct(\MultipleIterator::MIT_NEED_ALL|\MultipleIterator::MIT_KEYS_NUMERIC);
82 82
         $args = func_get_args();
83 83
         $argsContainsKeyFunc = $args[1] instanceof \Closure;
84 84
         $this->valueFunc = $args[0];
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         if ($argsContainsKeyFunc) {
87 87
             $this->keyFunc = $args[1];
88 88
         } else {
89
-            $this->keyFunc = function () {
89
+            $this->keyFunc = function() {
90 90
                 return $this->genericKeysToKey(func_get_args());
91 91
             };
92 92
         }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 return join(
125 125
                     ':',
126 126
                     array_map(
127
-                        function ($key) {
127
+                        function($key) {
128 128
                             return (string)$key;
129 129
                         },
130 130
                         $keys
Please login to merge, or discard this patch.