From 0ef74f1096bc08f80d95e9f86d88018d25473f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 1 Mar 2022 16:32:32 +0800 Subject: [PATCH] modify plugin name --- EnumValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EnumValidator.php b/EnumValidator.php index 0de1348..2ae7d87 100644 --- a/EnumValidator.php +++ b/EnumValidator.php @@ -21,7 +21,7 @@ class EnumValidator extends BaseValidator { return $this->_validator($this->field, function ($field, $params, $values) { $value = $params[$field] ?? null; - if (empty($value)) { + if (is_null($value) || $value === '') { return $this->addError($field,'The param :attribute is null'); } if (!in_array($value, $values)) {