From 49838fac9cc7b0828380c2a8c41b6c5502eaa98d Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Thu, 4 Apr 2024 13:16:25 +0200 Subject: [PATCH] fix(type): Positive int has a broken exception path --- src/Psl/Type/Internal/PositiveIntType.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Psl/Type/Internal/PositiveIntType.php b/src/Psl/Type/Internal/PositiveIntType.php index 10c46ae4..4ad723bb 100644 --- a/src/Psl/Type/Internal/PositiveIntType.php +++ b/src/Psl/Type/Internal/PositiveIntType.php @@ -58,10 +58,7 @@ public function coerce(mixed $value): int return $int; } - // Exceptional case "000" -(trim)-> "", but we treat it as 0 - if ('' === $trimmed && '' !== $str) { - CoercionException::withValue($value, $this->toString()); - } + throw CoercionException::withValue($value, $this->toString()); } if (is_float($value)) {