From 3ede2769d653f5a8df2d21674468502b848107ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 21 Aug 2023 16:31:58 +0800 Subject: [PATCH] qqq --- src/Validator/Inject/Length.php | 2 +- src/Validator/Inject/MaxLength.php | 2 +- src/Validator/Inject/MinLength.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Validator/Inject/Length.php b/src/Validator/Inject/Length.php index 9c46536..7cd2e41 100644 --- a/src/Validator/Inject/Length.php +++ b/src/Validator/Inject/Length.php @@ -26,6 +26,6 @@ class Length implements ValidatorInterface public function dispatch(object $class, string $name): bool { // TODO: Implement dispatch() method. - return mb_strlen($class->{$name}) === $this->value; + return mb_strlen((string)$class->{$name}) === $this->value; } } diff --git a/src/Validator/Inject/MaxLength.php b/src/Validator/Inject/MaxLength.php index 0fde4cc..8af4b86 100644 --- a/src/Validator/Inject/MaxLength.php +++ b/src/Validator/Inject/MaxLength.php @@ -26,6 +26,6 @@ class MaxLength implements ValidatorInterface public function dispatch(object $class, string $name): bool { // TODO: Implement dispatch() method. - return mb_strlen($class->{$name}) <= $this->value; + return mb_strlen((string)$class->{$name}) <= $this->value; } } diff --git a/src/Validator/Inject/MinLength.php b/src/Validator/Inject/MinLength.php index 0eaaf53..46973cb 100644 --- a/src/Validator/Inject/MinLength.php +++ b/src/Validator/Inject/MinLength.php @@ -26,6 +26,6 @@ class MinLength implements ValidatorInterface public function dispatch(object $class, string $name): bool { // TODO: Implement dispatch() method. - return mb_strlen($class->{$name}) <= $this->value; + return mb_strlen((string)$class->{$name}) <= $this->value; } }