private function doChecks($checks)
    {
        $errors = [];
        foreach ($checks as $check) {
            try {
                $check();
            } catch (Exception $e) {
                $errors[] = $e;
            }
        }
        if (count($errors)) {
            throw (new MultipleExceptions)->setExceptions($errors);
        }
    }
private function doChecks($checks)
    {
        $errors = [];
        foreach ($checks as $check) {
            try {
                $check();
            } catch (Exception $e) {
                $errors[] = $e;
            }
        }
        if (count($errors)) {
            throw (new MultipleExceptions)->setExceptions($errors);
        }
    }
private function doChecks ( $ checks ) { $ errors = [ ] ; foreach ( $ checks as $ check ) { try { $ check ( ) ; } catch ( Exception $ e ) { $ errors [ ] = $ e ; } } if ( count ( $ errors ) ) { throw ( new MultipleExceptions ) -> setExceptions ( $ errors ) ; } }
does all the checks in the closures and merge any exceptions into one big exception
@param \Closure[] $checks
@throws MultipleExceptions
does all the checks in the closures and merge any exceptions into one big exception