modify plugin name

This commit is contained in:
2022-03-01 16:33:02 +08:00
parent 0ef74f1096
commit a87b6288be
+1 -5
View File
@@ -20,11 +20,7 @@ class EnumValidator extends BaseValidator
public function trigger(): bool
{
return $this->_validator($this->field, function ($field, $params, $values) {
$value = $params[$field] ?? null;
if (is_null($value) || $value === '') {
return $this->addError($field,'The param :attribute is null');
}
if (!in_array($value, $values)) {
if (!in_array($params[$field] ?? null, $values)) {
return $this->addError($field,'The param :attribute value only in ' . implode(',', $values));
}
return true;