loophp /
collection
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace loophp\collection\Contract\Operation; |
||
| 6 | |||
| 7 | use loophp\collection\Contract\Collection; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * @template TKey |
||
| 11 | * @template T |
||
| 12 | */ |
||
| 13 | interface CountInAble |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * This operation requires a reference to a parameter that will contain the |
||
| 17 | * amount of items in the collection. The difference with the `count` |
||
| 18 | * operation is that the `count` operation will return the amount of items |
||
| 19 | * in the collection and the `countIn` operation will yield over the |
||
| 20 | * collection itself while updating the counter variable. |
||
| 21 | * |
||
| 22 | * @see https://loophp-collection.readthedocs.io/en/stable/pages/api.html#countIn |
||
| 23 | * |
||
| 24 | * @param non-negative-int $counter |
||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
| 25 | * |
||
| 26 | * @return Collection<TKey, T> |
||
| 27 | */ |
||
| 28 | public function countIn(int &$counter): Collection; |
||
| 29 | } |
||
| 30 |