Skip to content

Commit 61c7950

Browse files
Merge branch '4.2' into 4.3
* 4.2: [Cache] replace getNsSeparator by NS_SEPARATOR on AbstractTrait [Cache] fix versioning with SimpleCacheAdapter Fix expired lock not cleaned [HttpFoundation] Fix SA/phpdoc JsonResponse SimpleCacheAdapter fails to cache any item if a namespace is used validate composite constraints in all groups [Serializer] Handle true and false appropriately in CSV encoder Fix binary operation `+`, `-` or `*` on string [VarDumper] fix dumping objects that implement __debugInfo() [Routing] fix absolute url generation when scheme is not known
2 parents 2af0b2f + 44a7fef commit 61c7950

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Constraints/IssnValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function validate($value, Constraint $constraint)
121121

122122
for ($i = 0; $i < 7; ++$i) {
123123
// Multiply the first digit by 8, the second by 7, etc.
124-
$checkSum += (8 - $i) * $canonical[$i];
124+
$checkSum += (8 - $i) * (int) $canonical[$i];
125125
}
126126

127127
if (0 !== $checkSum % 11) {

Constraints/LuhnValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function validate($value, Constraint $constraint)
8484
// ^ ^ ^ ^ ^
8585
// = 1+8 + 4 + 6 + 1+6 + 2
8686
for ($i = $length - 2; $i >= 0; $i -= 2) {
87-
$checkSum += array_sum(str_split($value[$i] * 2));
87+
$checkSum += array_sum(str_split((int) $value[$i] * 2));
8888
}
8989

9090
if (0 === $checkSum || 0 !== $checkSum % 10) {

0 commit comments

Comments
 (0)