@@ -31,7 +31,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |