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; } }