Skip to content

Commit

Permalink
fix(type): Positive int has a broken exception path (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee authored Apr 4, 2024
1 parent 9ebf54f commit f114031
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Psl/Type/Internal/PositiveIntType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit f114031

Please sign in to comment.