@@ -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')); |
@@ -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 | }; |