1 | <?php |
||
11 | trait UniqueTrait |
||
12 | { |
||
13 | /** |
||
14 | * Returns an iterator where the values from $strategy are unique |
||
15 | * |
||
16 | * The $strategy is used to get values for every element in this iterable, |
||
17 | * when this value has already been encountered the element is not |
||
18 | * part of the returned iterator |
||
19 | * |
||
20 | * > iter\iterable([1, 1, 2, 2, 3, 3])->unique() |
||
21 | * 1 2 3 |
||
22 | * |
||
23 | * > iter\iterable([['id' => 1, 'value' => 'a'], ['id' => 1, 'value' => 'b']])->unique('id') |
||
24 | * ['id' => 1, 'value' => 'a'] # one element in this list |
||
25 | * |
||
26 | * @param null|string|\Closure $strategy |
||
27 | * @return UniqueIterator |
||
28 | */ |
||
29 | 19 | public function unique($strategy = null) |
|
40 | } |
||
41 |
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.