From 7e356aadbab4c64c3077a4d558f25bc905add1c5 Mon Sep 17 00:00:00 2001 From: whwyy Date: Wed, 13 Dec 2023 19:03:11 +0800 Subject: [PATCH] eee --- src/Validator/Validator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Validator/Validator.php b/src/Validator/Validator.php index 3ff6066..bae6b16 100644 --- a/src/Validator/Validator.php +++ b/src/Validator/Validator.php @@ -158,13 +158,13 @@ class Validator * @return array * @throws Exception */ - protected function arrayCheck(ReflectionNamedType $property, string $name, string|array $value): array + protected function arrayCheck(ReflectionNamedType $property, string $name, string|array $value): ?array { if (empty($value) || !is_array($value)) { if ($property->allowsNull()) { - $this->formData->{$name} = null; + return null; } - throw new Exception('TypeError Cannot assign string to property ' . $name . ' of type array'); + throw new Exception('Cannot assign non null values to property ' . $name . ' of type array'); } return $value; }