@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function lstrip($chars = " \t\n\r\0\x0B") |
17 | 17 | { |
18 | - return function ($value) use ($chars) { |
|
18 | + return function($value) use ($chars) { |
|
19 | 19 | return ltrim($value, $chars); |
20 | 20 | }; |
21 | 21 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function rstrip($chars = " \t\n\r\0\x0B") |
30 | 30 | { |
31 | - return function ($value) use ($chars) { |
|
31 | + return function($value) use ($chars) { |
|
32 | 32 | return rtrim($value, $chars); |
33 | 33 | }; |
34 | 34 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | function strip($chars = " \t\n\r\0\x0B") |
43 | 43 | { |
44 | - return function ($value) use ($chars) { |
|
44 | + return function($value) use ($chars) { |
|
45 | 45 | return trim($value, $chars); |
46 | 46 | }; |
47 | 47 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | function length() |
55 | 55 | { |
56 | - return function ($value) { |
|
56 | + return function($value) { |
|
57 | 57 | if (is_null($value)) { |
58 | 58 | return 0; |
59 | 59 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | function key() |
75 | 75 | { |
76 | - return function ($value, $key) { |
|
76 | + return function($value, $key) { |
|
77 | 77 | return $key; |
78 | 78 | }; |
79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | function lower() |
87 | 87 | { |
88 | - return function ($value) { |
|
88 | + return function($value) { |
|
89 | 89 | return strtolower($value); |
90 | 90 | }; |
91 | 91 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | function upper() |
99 | 99 | { |
100 | - return function ($value) { |
|
100 | + return function($value) { |
|
101 | 101 | return strtoupper($value); |
102 | 102 | }; |
103 | 103 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | function json_encode($options = 0, $depth = 512) |
113 | 113 | { |
114 | - return function ($value) use ($options, $depth) { |
|
114 | + return function($value) use ($options, $depth) { |
|
115 | 115 | return \json_encode($value, $options, $depth); |
116 | 116 | }; |
117 | 117 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | function json_decode($assoc = false, $depth = 512, $options = 0) |
128 | 128 | { |
129 | - return function ($value) use ($assoc, $depth, $options) { |
|
129 | + return function($value) use ($assoc, $depth, $options) { |
|
130 | 130 | return \json_decode($value, $assoc, $depth, $options); |
131 | 131 | }; |
132 | 132 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $strategies = array_map('\Zicht\Itertools\conversions\mixed_to_value_getter', (array)$strategies); |
168 | 168 | $strategy = conversions\mixed_to_value_getter($strategy); |
169 | 169 | |
170 | - return function ($value, $key) use ($strategies, $strategy, $discardNull, $discardEmptyContainer, $castToObject) { |
|
170 | + return function($value, $key) use ($strategies, $strategy, $discardNull, $discardEmptyContainer, $castToObject) { |
|
171 | 171 | $value = $strategy($value); |
172 | 172 | $res = []; |
173 | 173 | foreach ($strategies as $strategyKey => $strategy) { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | if ($discardNull || $discardEmptyContainer) { |
177 | 177 | $res = array_filter( |
178 | 178 | $res, |
179 | - function ($value) use ($discardNull, $discardEmptyContainer) { |
|
179 | + function($value) use ($discardNull, $discardEmptyContainer) { |
|
180 | 180 | if (null === $value) { |
181 | 181 | return !$discardNull; |
182 | 182 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $max = getrandmax(); |
207 | 207 | } |
208 | 208 | |
209 | - return function () use ($min, $max) { |
|
209 | + return function() use ($min, $max) { |
|
210 | 210 | return rand($min, $max); |
211 | 211 | }; |
212 | 212 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | function type($strategy = null) |
221 | 221 | { |
222 | 222 | $strategy = conversions\mixed_to_value_getter($strategy); |
223 | - return function ($value) use ($strategy) { |
|
223 | + return function($value) use ($strategy) { |
|
224 | 224 | $value = $strategy($value); |
225 | 225 | return is_object($value) ? get_class($value) : gettype($value); |
226 | 226 | }; |