singleOr()
singleOr(mixed $default, callable $predicate = [Helpers::class, mixed $"yes"]) : mixed
Get the single element that satisfies the predicate (if no predicate is given, the single element), or get the default
Parameters
mixed |
$default |
|
callable |
$predicate |
|
mixed |
$"yes"] |
|
Returns
mixed