@@ -19,7 +19,6 @@ |
||
19 | 19 | /** |
20 | 20 | * Reduce an iterator to a single value |
21 | 21 | * |
22 | - * @param array|string|\Iterator $iterable |
|
23 | 22 | * @param string|\Closure $closure |
24 | 23 | * @param mixed $initializer |
25 | 24 | * @return mixed |
@@ -19,7 +19,6 @@ |
||
19 | 19 | /** |
20 | 20 | * Returns an iterator where one or more iterables are zipped together |
21 | 21 | * |
22 | - * @param array|string|\Iterator $iterable2 |
|
23 | 22 | * @return Itertools\lib\ZipIterator |
24 | 23 | * |
25 | 24 | * @see Itertools\lib\Traits\ZipTrait::zip |
@@ -26,8 +26,6 @@ |
||
26 | 26 | * > iter\iterable('ABC', 'DEF')->chain() |
27 | 27 | * A B C D E F |
28 | 28 | * |
29 | - * @param array|string|\Iterator $iterable |
|
30 | - * @param array|string|\Iterator $iterable2 |
|
31 | 29 | * @return null|ChainIterator |
32 | 30 | */ |
33 | 31 | public function chain(/* $iterable, $iterable2, ... */) |
@@ -35,7 +35,6 @@ |
||
35 | 35 | * 2.5 3.5 4.5 |
36 | 36 | * |
37 | 37 | * @param null|string|\Closure $strategy |
38 | - * @param array|string|\Iterator $iterable2 |
|
39 | 38 | * @return MapIterator |
40 | 39 | */ |
41 | 40 | public function map($strategy /*, $iterable2, ... */) |
@@ -22,7 +22,6 @@ |
||
22 | 22 | * > zip([1, 2, 3], ['a', 'b', 'c']) |
23 | 23 | * [1, 'a'] [2, 'b'] [3, 'c'] |
24 | 24 | * |
25 | - * @param array|string|\Iterator $iterable2 |
|
26 | 25 | * @return ZipIterator |
27 | 26 | */ |
28 | 27 | public function zip(/* $iterable2, ... */) |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | if ($this instanceof \Iterator) { |
24 | 24 | $strategy = conversions\mixed_to_value_getter($strategy); |
25 | - $isValid = function ($value, $key) use ($strategy) { |
|
25 | + $isValid = function($value, $key) use ($strategy) { |
|
26 | 26 | $tempVarPhp54 = $strategy($value, $key); |
27 | 27 | return !empty($tempVarPhp54); |
28 | 28 | }; |
@@ -28,7 +28,7 @@ discard block |
||
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 |
||
58 | 58 | $haystack = Itertools\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 |
||
80 | 80 | $haystack = Itertools\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 |
||
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 | } |
@@ -16,7 +16,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $strategies = array_map('\Zicht\Itertools\conversions\mixed_to_value_getter', $strategies); |
138 | 138 | $strategy = conversions\mixed_to_value_getter($strategy); |
139 | 139 | |
140 | - return function ($value, $key) use ($strategies, $strategy, $discardNull) { |
|
140 | + return function($value, $key) use ($strategies, $strategy, $discardNull) { |
|
141 | 141 | $value = $strategy($value); |
142 | 142 | $res = []; |
143 | 143 | foreach ($strategies as $strategyKey => $strategy) { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if ($discardNull) { |
147 | 147 | $res = array_filter( |
148 | 148 | $res, |
149 | - function ($value) { |
|
149 | + function($value) { |
|
150 | 150 | return null !== $value; |
151 | 151 | } |
152 | 152 | ); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $max = getrandmax(); |
169 | 169 | } |
170 | 170 | |
171 | - return function () use ($min, $max) { |
|
171 | + return function() use ($min, $max) { |
|
172 | 172 | return rand($min, $max); |
173 | 173 | }; |
174 | 174 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | function type($strategy = null) |
183 | 183 | { |
184 | 184 | $strategy = conversions\mixed_to_value_getter($strategy); |
185 | - return function ($value) use ($strategy) { |
|
185 | + return function($value) use ($strategy) { |
|
186 | 186 | $value = $strategy($value); |
187 | 187 | return is_object($value) ? get_class($value) : gettype($value); |
188 | 188 | }; |