diff --git a/src/Validator/Validator.php b/src/Validator/Validator.php index b1d850b..1f85f45 100644 --- a/src/Validator/Validator.php +++ b/src/Validator/Validator.php @@ -65,7 +65,7 @@ class Validator foreach ($data as $key => $value) { if (property_exists($this->formData, $key)) { $type = new \ReflectionProperty($this->formData, $key); - $value = match ($type->getType()->getName()) { + $value = match ($type?->getType()->getName()) { 'int' => (int)$value, 'float' => (float)$value, default => $value