@@ -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 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | function json_encode($options = 0, $depth = 512) |
| 114 | 114 | { |
| 115 | - return function ($value) use ($options, $depth) { |
|
| 115 | + return function($value) use ($options, $depth) { |
|
| 116 | 116 | return \json_encode($value, $options, $depth); |
| 117 | 117 | }; |
| 118 | 118 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | function json_decode($assoc = false, $depth = 512, $options = 0) |
| 129 | 129 | { |
| 130 | - return function ($value) use ($assoc, $depth, $options) { |
|
| 130 | + return function($value) use ($assoc, $depth, $options) { |
|
| 131 | 131 | return \json_decode($value, $assoc, $depth, $options); |
| 132 | 132 | }; |
| 133 | 133 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $strategies = array_map('\Zicht\Itertools\conversions\mixed_to_value_getter', $strategies); |
| 168 | 168 | $strategy = conversions\mixed_to_value_getter($strategy); |
| 169 | 169 | |
| 170 | - return function ($value, $key) use ($strategies, $strategy, $discardNull, $discardEmptyContainer) { |
|
| 170 | + return function($value, $key) use ($strategies, $strategy, $discardNull, $discardEmptyContainer) { |
|
| 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 | }; |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $array = iterator_to_array($this); |
| 30 | 30 | array_walk( |
| 31 | 31 | $array, |
| 32 | - function (&$value) { |
|
| 32 | + function(&$value) { |
|
| 33 | 33 | if ($value instanceof FiniteIterableInterface) { |
| 34 | 34 | $value = $value->toArray(); |
| 35 | 35 | } |
@@ -17,9 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * Make an iterator that applies $strategy to every entry in this iterable |
| 19 | 19 | * |
| 20 | - * @param null|string|\Closure $strategy |
|
| 21 | - * @param array|string|\Iterator $iterable |
|
| 22 | - * @param array|string|\Iterator $iterable2 |
|
| 20 | + * @param \Closure $strategy |
|
| 23 | 21 | * @return Itertools\lib\MapIterator |
| 24 | 22 | * |
| 25 | 23 | * @see Itertools\lib\Traits\MapTrait::map |
@@ -17,8 +17,6 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * Returns an iterator where one or more iterables are zipped together |
| 19 | 19 | * |
| 20 | - * @param array|string|\Iterator $iterable |
|
| 21 | - * @param array|string|\Iterator $iterable2 |
|
| 22 | 20 | * @return Itertools\lib\ZipIterator |
| 23 | 21 | * |
| 24 | 22 | * @see Itertools\lib\Traits\ZipTrait::zip |
@@ -36,8 +36,6 @@ |
||
| 36 | 36 | * 2.5 3.5 4.5 |
| 37 | 37 | * |
| 38 | 38 | * @param null|string|\Closure $strategy |
| 39 | - * @param array|string|\Iterator $iterable |
|
| 40 | - * @param array|string|\Iterator $iterable2 |
|
| 41 | 39 | * @return MapIterator |
| 42 | 40 | */ |
| 43 | 41 | public function map($strategy /*, $iterable, $iterable2, ... */) |
@@ -23,8 +23,6 @@ |
||
| 23 | 23 | * > zip([1, 2, 3], ['a', 'b', 'c']) |
| 24 | 24 | * [1, 'a'] [2, 'b'] [3, 'c'] |
| 25 | 25 | * |
| 26 | - * @param array|string|\Iterator $iterable |
|
| 27 | - * @param array|string|\Iterator $iterable2 |
|
| 28 | 26 | * @return ZipIterator |
| 29 | 27 | */ |
| 30 | 28 | public function zip(/* $iterable, $iterable2, ... */) |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function __construct() |
| 19 | 19 | { |
| 20 | - parent::__construct(\MultipleIterator::MIT_NEED_ALL | \MultipleIterator::MIT_KEYS_NUMERIC); |
|
| 20 | + parent::__construct(\MultipleIterator::MIT_NEED_ALL|\MultipleIterator::MIT_KEYS_NUMERIC); |
|
| 21 | 21 | foreach (func_get_args() as $iterable) { |
| 22 | 22 | if (!$iterable instanceof \Iterator) { |
| 23 | 23 | throw new \InvalidArgumentException(sprintf('Not all arguments are iterators')); |