Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4c9fce8

Browse filesBrowse files
committed
minor #40798 Fix CS in IsbnValidator and IssnValidator (guilliamxavier)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Fix CS in IsbnValidator and IssnValidator | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- dc90c19 Fix CS in IsbnValidator and IssnValidator
2 parents 3f42c08 + dc90c19 commit 4c9fce8
Copy full SHA for 4c9fce8

File tree

2 files changed

+2
-6
lines changed
Filter options

2 files changed

+2
-6
lines changed

‎src/Symfony/Component/Validator/Constraints/IsbnValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/IsbnValidator.php
+1-2Lines 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;

‎src/Symfony/Component/Validator/Constraints/IssnValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/IssnValidator.php
+1-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.