loophp /
collection
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace loophp\collection\Contract\Operation; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * @template TKey |
||
| 9 | * @template T |
||
| 10 | */ |
||
| 11 | interface Findable |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Find a value in the collection that matches all predicates or return the |
||
| 15 | * default value. |
||
| 16 | * |
||
| 17 | * @see https://loophp-collection.readthedocs.io/en/stable/pages/api.html#find |
||
| 18 | * |
||
| 19 | * @template V |
||
| 20 | * |
||
| 21 | * @param V $default |
||
| 22 | * @param (callable(T, TKey, iterable<TKey, T>): bool) ...$callbacks |
||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
| 23 | * |
||
| 24 | * @return T|V |
||
| 25 | */ |
||
| 26 | public function find(mixed $default = null, callable ...$callbacks); |
||
| 27 | } |
||
| 28 |