1 | <?php |
||
10 | trait ReduceTrait |
||
11 | { |
||
12 | /** |
||
13 | * Reduce an iterator to a single value |
||
14 | * |
||
15 | * > iter\iterable([1,2,3])->reduce() |
||
16 | * 6 |
||
17 | * |
||
18 | * > iter\iterable([1,2,3])->reduce('max') |
||
19 | * 3 |
||
20 | * |
||
21 | * > iter\iterable([1,2,3])->reduce('sub', 10) |
||
22 | * 4 |
||
23 | * |
||
24 | * > iter\iterable([])->reduce('min', 1) |
||
25 | * 1 |
||
26 | * |
||
27 | * @param string|\Closure $closure |
||
28 | * @param mixed $initializer |
||
29 | * @return mixed |
||
30 | */ |
||
31 | 58 | public function reduce($closure = 'add', $initializer = null) |
|
55 | } |
||
56 |
This function has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.