public static function isValidSize($size, $throw = false)
    {
        if (in_array($size, static::getSizes(), true)) {
            return true;
        }

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

        return false;
    }