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 1/2] 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; From 1a7a3db18ffb47b3406a072ae3f3e00c70ed503a Mon Sep 17 00:00:00 2001 From: MartinBeranek Date: Wed, 15 Jul 2026 10:21:50 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39b083b..7e2b257 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. ## [Unreleased][unreleased] +### Fixed +- Invalid input type returned when value is empty in InputValidator ## 3.4.2 ### Fixed