Skip to content

[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

Merged
merged 1 commit into from
Aug 2, 2020
Merged

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Jul 12, 2020

Co-Authored-By: Yannis Foucher 33806646+YaFou@users.noreply.github.com

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #36362
License MIT
Doc PR symfony/symfony-docs#13960

Rebase of #36368

I asked him by mail and he didn't have time to finish the PR and allowed me to do it.

// subtract from 10
$rem = 10 - $mod;

// mod from 10 to catch if the result was 0
Copy link
Member

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

Copy link
Contributor Author

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 ?

@VincentLanglet VincentLanglet force-pushed the isin branch 2 times, most recently from a566236 to e15cb19 Compare July 22, 2020 20:09
/**
* This method performs the Luhn algorithm to obtain a check digit.
*/
private function getCheckDigit(string $input): int
Copy link
Member

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.

Copy link
Contributor Author

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>
@nicolas-grekas nicolas-grekas changed the title Feature #36362: Add Isin validator constraint [Validator] Add Isin validator constraint Aug 1, 2020
@fabpot
Copy link
Member

fabpot commented Aug 2, 2020

Thank you @VincentLanglet.

@fabpot fabpot merged commit f76ac74 into symfony:master Aug 2, 2020
xabbuh added a commit to symfony/symfony-docs that referenced this pull request Aug 3, 2020
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
@VincentLanglet VincentLanglet deleted the isin branch August 12, 2020 08:28
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.2 Oct 5, 2020
@fabpot fabpot mentioned this pull request Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ISIN code validator
7 participants