-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Add Isin validator constraint #37565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/Symfony/Component/Validator/Tests/Constraints/IsinValidatorTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Tests/Constraints/IsinValidatorTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf
Outdated
Show resolved
Hide resolved
// subtract from 10 | ||
$rem = 10 - $mod; | ||
|
||
// mod from 10 to catch if the result was 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these comments above add value, the code tells the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remove some comments. WDYT now ?
a566236
to
e15cb19
Compare
/** | ||
* This method performs the Luhn algorithm to obtain a check digit. | ||
*/ | ||
private function getCheckDigit(string $input): int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, we should probably use the Luhn validator, that would avoid having 2 implementations of the same algo in code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I made the changes. Is it ok the way I did @fabpot ?
Feature symfony#36362 typo Fix PR feedbacks Fix coding standard ticket 36362 fix PR feedbacks Update src/Symfony/Component/Validator/Constraints/IsinValidator.php Co-Authored-By: Yannis Foucher <33806646+YaFou@users.noreply.github.com>
Thank you @VincentLanglet. |
This PR was merged into the master branch. Discussion ---------- Add doc for Isin constraint Related to symfony/symfony#37565 Commits ------- 9b7bae9 Add doc for Isin constraint
Co-Authored-By: Yannis Foucher 33806646+YaFou@users.noreply.github.com
Rebase of #36368
I asked him by mail and he didn't have time to finish the PR and allowed me to do it.