Skip to content

Commit 65525b9

Browse files
guilliamxavierNyholm
authored andcommitted
Fix CS in IsbnValidator and IssnValidator
1 parent 4409767 commit 65525b9

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Constraints/IsbnValidator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ protected function validateIsbn13($isbn)
163163
}
164164

165165
for ($i = 1; $i < 12; $i += 2) {
166-
$checkSum += $isbn[$i]
167-
* 3;
166+
$checkSum += $isbn[$i] * 3;
168167
}
169168

170169
return 0 === $checkSum % 10 ? true : Isbn::CHECKSUM_FAILED_ERROR;

Constraints/IssnValidator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ public function validate($value, Constraint $constraint)
114114
}
115115

116116
// Calculate a checksum. "X" equals 10.
117-
$checkSum = 'X' === $canonical[7]
118-
|| 'x' === $canonical[7]
119-
? 10
120-
: $canonical[7];
117+
$checkSum = 'X' === $canonical[7] || 'x' === $canonical[7] ? 10 : $canonical[7];
121118

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

0 commit comments

Comments
 (0)