Skip to content

Commit 0330f41

Browse files
committed
Prevent type-error when LengthValidator is populated from XML layout
1 parent 480a0a1 commit 0330f41

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Validator/LengthValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private function getMin(AbstractBlock $block): int
4242

4343
$fieldAttributes = (array)$block->getFieldAttributes();
4444
if (!empty($fieldAttributes[$possibleValue])) {
45-
return $fieldAttributes[$possibleValue];
45+
return (int)$fieldAttributes[$possibleValue];
4646
}
4747
}
4848

@@ -59,7 +59,7 @@ private function getMax(AbstractBlock $block): int
5959

6060
$fieldAttributes = (array)$block->getFieldAttributes();
6161
if (!empty($fieldAttributes[$possibleValue])) {
62-
return $fieldAttributes[$possibleValue];
62+
return (int)$fieldAttributes[$possibleValue];
6363
}
6464
}
6565

0 commit comments

Comments
 (0)