src/Traits/Collections.php
public static function every($collection, Closure $iterateFn): bool
    {
        $truthy = true;

        __::doForEach(
            $collection,
            function ($value, $key, $collection) use (&$truthy, $iterateFn) {
                $truthy = $truthy && $iterateFn($value, $key, $collection);
                if (!$truthy) {
                    return false;
                }
            }
        );

        return $truthy;
    }
public static function every($collection, Closure $iterateFn): bool
    {
        $truthy = true;

        __::doForEach(
            $collection,
            function ($value, $key, $collection) use (&$truthy, $iterateFn) {
                $truthy = $truthy && $iterateFn($value, $key, $collection);
                if (!$truthy) {
                    return false;
                }
            }
        );

        return $truthy;
    }
public static function every ( $ collection , Closure $ iterateFn ) : bool { $ truthy = true ; __ :: doForEach ( $ collection , function ( $ value , $ key , $ collection ) use ( & $ truthy , $ iterateFn ) { $ truthy = $ truthy && $ iterateFn ( $ value , $ key , $ collection ) ; if ( ! $ truthy ) { return false ; } } ) ; return $ truthy ; }
Checks if predicate returns truthy for all elements of collection.

Iteration is stopped once predicate returns falsey.
The predicate is invoked with three arguments: (value, index|key, collection).

@usage __::every([1, 3, 4], function ($v) { return is_int($v); });
>> true

@param array|object $collection The collection to iterate over.
@param \Closure     $iterateFn  The function to call for each value.

@return bool
Checks if predicate returns truthy for all elements of collection .