We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41bdc50 commit cea8110Copy full SHA for cea8110
src/Geography/Address/ByCountry/Us/ZipCode.php
@@ -23,7 +23,7 @@ protected function setValue(string $value): void
23
$characters++;
24
}
25
26
- if (empty($value) || $characters != 5 && $characters != 9 && ctype_digit($value)) {
+ if (empty($value) || ctype_digit($value) !== true || ($characters != 5 && $characters != 9)) {
27
throw new \InvalidArgumentException(sprintf('The value "%s" is not a valid postal code.', $value));
28
29
0 commit comments