Nayjest\Collection\CollectionReadInterface::filter
Iterates over each value in the <b>collection</b> passing them to the <b>callback</b> function.
If the <b>callback</b> function returns true, the current value from <b>collection</b> is returned into the result collection.
Signature
public function filter(callable
$callback,
[array|null
$optionalArguments = null] )
Parameters
$callback
— Nayjest\Collection\callable- the callback function to use
$optionalArguments
— object- [optional] additional arguments passed to callback
Returns
- CollectionReadInterface|static
- filtered collection