Skip to content

Commit 758b829

Browse files
authored
Fix issue with deprecation error in PHP 8.1 (#46)
Fixes #45
1 parent e7fb22a commit 758b829

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ZipCodeValidator/Constraints/ZipCodeValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function validate($value, Constraint $constraint)
228228
return;
229229
}
230230

231-
if (!($iso = strtoupper($constraint->iso))) {
231+
if (null === $constraint->iso || !($iso = strtoupper($constraint->iso))) {
232232
// if iso code is not specified, try to fetch it via getter from the object, which is currently validated
233233
$object = $this->context->getObject();
234234
$getter = $constraint->getter;

0 commit comments

Comments
 (0)