From 3f9ac05a4dead700db4fa5e34f0787deec0a97cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=CC=81n=20Gemmel?= <> Date: Tue, 14 Apr 2026 13:47:56 +0200 Subject: [PATCH] Convert empty string to numeric type --- src/Validation/InputValidator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Validation/InputValidator.php b/src/Validation/InputValidator.php index cb326b1..c8d49b4 100644 --- a/src/Validation/InputValidator.php +++ b/src/Validation/InputValidator.php @@ -76,17 +76,17 @@ public function transformType($value, $expectedType = null): mixed } // no break case InputType::INTEGER: - if (is_numeric($value)) { + if (is_numeric($value) || $value === '') { settype($value, 'integer'); } break; case InputType::DOUBLE: - if (is_numeric($value)) { + if (is_numeric($value) || $value === '') { settype($value, 'double'); } break; case InputType::FLOAT: - if (is_numeric($value)) { + if (is_numeric($value) || $value === '') { settype($value, 'float'); } break;