Skip to content

Commit f114031

Browse files
authored
fix(type): Positive int has a broken exception path (#459)
1 parent 9ebf54f commit f114031

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Psl/Type/Internal/PositiveIntType.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ public function coerce(mixed $value): int
5858
return $int;
5959
}
6060

61-
// Exceptional case "000" -(trim)-> "", but we treat it as 0
62-
if ('' === $trimmed && '' !== $str) {
63-
CoercionException::withValue($value, $this->toString());
64-
}
61+
throw CoercionException::withValue($value, $this->toString());
6562
}
6663

6764
if (is_float($value)) {

0 commit comments

Comments
 (0)