@@ -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 | return $value instanceof \DateTimeInterface && ($orEqual ? $expected <= $value : $expected < $value); |
| 157 | 157 | }; |
@@ -159,14 +159,14 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | // Support numbers |
| 161 | 161 | if (is_int($expected) || is_float($expected)) { |
| 162 | - return function ($value, $key = null) use ($expected, $strategy, $orEqual) { |
|
| 162 | + return function($value, $key = null) use ($expected, $strategy, $orEqual) { |
|
| 163 | 163 | $value = $strategy($value, $key); |
| 164 | 164 | return (is_int($value) || is_float($value)) && ($orEqual ? $expected <= $value : $expected < $value); |
| 165 | 165 | }; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | // Everything else fails |
| 169 | - return function () { |
|
| 169 | + return function() { |
|
| 170 | 170 | return false; |
| 171 | 171 | }; |
| 172 | 172 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | // Support DateTimeInterface |
| 193 | 193 | if ($expected instanceof \DateTimeInterface) { |
| 194 | - return function ($value, $key = null) use ($expected, $strategy, $orEqual) { |
|
| 194 | + return function($value, $key = null) use ($expected, $strategy, $orEqual) { |
|
| 195 | 195 | $value = $strategy($value, $key); |
| 196 | 196 | return $value instanceof \DateTimeInterface && ($orEqual ? $expected >= $value : $expected > $value); |
| 197 | 197 | }; |
@@ -199,14 +199,14 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | // Support numbers |
| 201 | 201 | if (is_int($expected) || is_float($expected)) { |
| 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 | return (is_int($value) || is_float($value)) && ($orEqual ? $expected >= $value : $expected > $value); |
| 205 | 205 | }; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | // Everything else fails |
| 209 | - return function () { |
|
| 209 | + return function() { |
|
| 210 | 210 | return false; |
| 211 | 211 | }; |
| 212 | 212 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | function not($strategy = null) |
| 227 | 227 | { |
| 228 | 228 | $strategy = conversions\mixed_to_value_getter($strategy); |
| 229 | - return function ($value, $key = null) use ($strategy) { |
|
| 229 | + return function($value, $key = null) use ($strategy) { |
|
| 230 | 230 | return !($strategy($value, $key)); |
| 231 | 231 | }; |
| 232 | 232 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | $strategy = conversions\mixed_to_value_getter($strategy); |
| 254 | - return function ($value, $key = null) use ($pattern, $strategy) { |
|
| 254 | + return function($value, $key = null) use ($pattern, $strategy) { |
|
| 255 | 255 | return (bool)preg_match($pattern, $strategy($value, $key)); |
| 256 | 256 | }; |
| 257 | 257 | } |