public static function isValidFormat($format, $throw = false)
    {
        if (in_array($format, static::getFormats(), true)) {
            return true;
        }

        if ($throw) {
            throw new InvalidArgumentException("Unknown format '$format'.");
        }

        return false;
    }
public static function isValidFormat($format, $throw = false)
    {
        if (in_array($format, static::getFormats(), true)) {
            return true;
        }

        if ($throw) {
            throw new InvalidArgumentException("Unknown format '$format'.");
        }

        return false;
    }
Returns whether the given format is valid.

@param string $format
@param bool   $throw

@return bool