Skip to content

Commit

Permalink
Merge branch '4.4' into 5.2
Browse files Browse the repository at this point in the history
* 4.4:
  [FrameworkBundle] Fix messenger.receiver_locator service definition
  Fix CS in IsbnValidator and IssnValidator
  • Loading branch information
chalasr committed Apr 14, 2021
2 parents d879dd4 + 65525b9 commit b0be036
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Constraints/IsbnValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ protected function validateIsbn13($isbn)
}

for ($i = 1; $i < 12; $i += 2) {
$checkSum += $isbn[$i]
* 3;
$checkSum += $isbn[$i] * 3;
}

return 0 === $checkSum % 10 ? true : Isbn::CHECKSUM_FAILED_ERROR;
Expand Down
5 changes: 1 addition & 4 deletions Constraints/IssnValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ public function validate($value, Constraint $constraint)
}

// Calculate a checksum. "X" equals 10.
$checkSum = 'X' === $canonical[7]
|| 'x' === $canonical[7]
? 10
: $canonical[7];
$checkSum = 'X' === $canonical[7] || 'x' === $canonical[7] ? 10 : $canonical[7];

for ($i = 0; $i < 7; ++$i) {
// Multiply the first digit by 8, the second by 7, etc.
Expand Down

0 comments on commit b0be036

Please sign in to comment.