groupAnd. Reads naturally: "all of these predicates".
Creates a predicate Closure that is true only when every bound predicate returns true for the input value. Alias of groupAnd.
/**
* @param callable(mixed):bool ...$callables
* @return Closure(mixed):bool
*/
Comparisons\all(callable ...$callables): ClosureWhen Comparisons\all() is called, it returns the following Closure which can be used like a regular function.
/**
* @param mixed $value
* @return bool
*/
$function ($value): boolThis can be used to create a simple closure which can be used as a regular function.
$adultString = Comparisons\all(
'is_string',
fn($s) => strlen($s) >= 18
);
var_dump($adultString('a full length name here')); // true
var_dump($adultString('short')); // false