From f368ff97ab71258de42622c7e41c5434b2ca440a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 25 Apr 2023 17:05:06 +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 | 6 +++--- Validator.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LengthValidator.php b/LengthValidator.php index d7332b5..cf548a9 100644 --- a/LengthValidator.php +++ b/LengthValidator.php @@ -35,9 +35,9 @@ class LengthValidator extends BaseValidator } } return match ($method) { - self::MAX_LENGTH => $this->maxLength($field, $value), - self::MIN_LENGTH => $this->minLength($field, $value), - default => $this->defaultLength($field, $value), + self::MAX_LENGTH => $this->maxLength($field, (string)$value), + self::MIN_LENGTH => $this->minLength($field, (string)$value), + default => $this->defaultLength($field, (string)$value), }; }, $this->params, strtolower($this->method), $this->value); } diff --git a/Validator.php b/Validator.php index b323e77..f588e1a 100644 --- a/Validator.php +++ b/Validator.php @@ -87,11 +87,11 @@ class Validator extends BaseValidator 'class' => 'validator\TypesOfValidator', 'method' => TypesOfValidator::SERIALIZE, ], - 'maxLength' => [ + 'maxlength' => [ 'class' => 'validator\LengthValidator', 'method' => 'max', ], - 'minLength' => [ + 'minlength' => [ 'class' => 'validator\LengthValidator', 'method' => 'min', ],