From 726742f66f2c3eb4a5efe0d0cac40020477eb01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 21 Apr 2023 23:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LengthValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LengthValidator.php b/LengthValidator.php index 98d17d3..d7332b5 100644 --- a/LengthValidator.php +++ b/LengthValidator.php @@ -25,8 +25,8 @@ class LengthValidator extends BaseValidator */ public function trigger(): bool { - return $this->_validator($this->field, function ($field, $params, $method, $value) { - $value = $params[$this->field] ?? null; + return $this->_validator($this->field, function ($field, $params, $method, $length) { + $value = $params[$field] ?? null; if (empty($value)) { if ($method != self::MAX_LENGTH) { return $this->addError($field, 'The param :attribute not exists');