src/Request/Formatter/EnumFormatter.php
protected function formatEnumRule($rule)
    {
        if (!isset($rule['range'])) {
            throw new InternalServerError(
                T("miss {name}'s enum range", ['name' => $rule['name']]));
        }

        if (empty($rule['range']) || !is_array($rule['range'])) {
            throw new InternalServerError(
                T("{name}'s enum range can not be empty", ['name' => $rule['name']]));
        }
    }
protected function formatEnumRule($rule)
    {
        if (!isset($rule['range'])) {
            throw new InternalServerError(
                T("miss {name}'s enum range", ['name' => $rule['name']]));
        }

        if (empty($rule['range']) || !is_array($rule['range'])) {
            throw new InternalServerError(
                T("{name}'s enum range can not be empty", ['name' => $rule['name']]));
        }
    }
检测枚举规则的合法性

@param array $rule ['name' => '', 'type' => 'enum', 'default' => '', 'range' => []]
@throws InternalServerError