Fusonic\Linq\Linq::all PHP Method

all() public method

Determines whether all elements satisfy a condition.
public all ( callable $func ) : boolean
$func callable A function to test each element for a condition.
return boolean True if every element passes the test in the specified func, or if the sequence is empty; otherwise, false.
    public function all(callable $func)
    {
        foreach ($this->iterator as $current) {
            $match = LinqHelper::getBoolOrThrowException($func($current));
            if (!$match) {
                return false;
            }
        }
        return true;
    }