Passed
Pull Request — master (#57)
by
unknown
02:46
created
src/Zicht/Itertools/filters.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 function type($class, $strategy = null)
32 32
 {
33 33
     $strategy = conversions\mixed_to_value_getter($strategy);
34
-    return function ($value, $key = null) use ($class, $strategy) {
34
+    return function($value, $key = null) use ($class, $strategy) {
35 35
         return $strategy($value, $key) instanceof $class;
36 36
     };
37 37
 }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $haystack = Itertools\iterable($haystack)->values();
66 66
     }
67 67
     $strategy = conversions\mixed_to_value_getter($strategy);
68
-    return function ($value, $key = null) use ($haystack, $strategy, $strict) {
68
+    return function($value, $key = null) use ($haystack, $strategy, $strict) {
69 69
         return in_array($strategy($value, $key), $haystack, $strict);
70 70
     };
71 71
 }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $haystack = Itertools\iterable($haystack)->values();
90 90
     }
91 91
     $strategy = conversions\mixed_to_value_getter($strategy);
92
-    return function ($value, $key = null) use ($haystack, $strategy, $strict) {
92
+    return function($value, $key = null) use ($haystack, $strategy, $strict) {
93 93
         return !in_array($strategy($value, $key), $haystack, $strict);
94 94
     };
95 95
 }
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
     }
122 122
     $strategy = conversions\mixed_to_value_getter($strategy);
123 123
     if ($strict) {
124
-        return function ($value, $key = null) use ($expected, $strategy) {
124
+        return function($value, $key = null) use ($expected, $strategy) {
125 125
             return $expected === $strategy($value, $key);
126 126
         };
127 127
     } else {
128
-        return function ($value, $key = null) use ($expected, $strategy) {
128
+        return function($value, $key = null) use ($expected, $strategy) {
129 129
             return $expected == $strategy($value, $key);
130 130
         };
131 131
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
     // Support DateTimeInterface
153 153
     if ($expected instanceof \DateTimeInterface) {
154
-        return function ($value, $key = null) use ($expected, $strategy, $orEqual) {
154
+        return function($value, $key = null) use ($expected, $strategy, $orEqual) {
155 155
             $value = $strategy($value, $key);
156 156
             // Try to convert strings that are longer than 3 characters.  This simple test will ensure
157 157
             // that '' or 'now' will not be accepted.
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
 
168 168
     // Support numbers
169 169
     if (is_int($expected) || is_float($expected)) {
170
-        return function ($value, $key = null) use ($expected, $strategy, $orEqual) {
170
+        return function($value, $key = null) use ($expected, $strategy, $orEqual) {
171 171
             $value = $strategy($value, $key);
172 172
             return (is_int($value) || is_float($value)) && ($orEqual ? $expected <= $value : $expected < $value);
173 173
         };
174 174
     }
175 175
 
176 176
     // Everything else fails
177
-    return function () {
177
+    return function() {
178 178
         return false;
179 179
     };
180 180
 }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
     // Support DateTimeInterface
201 201
     if ($expected instanceof \DateTimeInterface) {
202
-        return function ($value, $key = null) use ($expected, $strategy, $orEqual) {
202
+        return function($value, $key = null) use ($expected, $strategy, $orEqual) {
203 203
             $value = $strategy($value, $key);
204 204
             // Try to convert strings that are longer than 3 characters.  This simple test will ensure
205 205
             // that '' or 'now' will not be accepted.
@@ -215,14 +215,14 @@  discard block
 block discarded – undo
215 215
 
216 216
     // Support numbers
217 217
     if (is_int($expected) || is_float($expected)) {
218
-        return function ($value, $key = null) use ($expected, $strategy, $orEqual) {
218
+        return function($value, $key = null) use ($expected, $strategy, $orEqual) {
219 219
             $value = $strategy($value, $key);
220 220
             return (is_int($value) || is_float($value)) && ($orEqual ? $expected >= $value : $expected > $value);
221 221
         };
222 222
     }
223 223
 
224 224
     // Everything else fails
225
-    return function () {
225
+    return function() {
226 226
         return false;
227 227
     };
228 228
 }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 function not($strategy = null)
243 243
 {
244 244
     $strategy = conversions\mixed_to_value_getter($strategy);
245
-    return function ($value, $key = null) use ($strategy) {
245
+    return function($value, $key = null) use ($strategy) {
246 246
         return !($strategy($value, $key));
247 247
     };
248 248
 }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     }
268 268
 
269 269
     $strategy = conversions\mixed_to_value_getter($strategy);
270
-    return function ($value, $key = null) use ($pattern, $strategy) {
270
+    return function($value, $key = null) use ($pattern, $strategy) {
271 271
         return (bool)preg_match($pattern, $strategy($value, $key));
272 272
     };
273 273
 }
Please login to merge, or discard this patch.