-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Form] [Validator] Added IBAN validator #6677
Conversation
First of... please fix Coding Standards to match Symfony2. =) |
*/ | ||
public function validate($value, Constraint $constraint) | ||
{ | ||
|
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.
Missing empty string validation skip:
if (null === $value || '' === $value) {
return;
}
Thanks for your feedback. I updated the code and hope things are ok now. |
} | ||
|
||
$teststring = preg_replace('/\s+/', '', $value); | ||
$teststring = substr($teststring,4) |
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.
missing space after the comma
In french (fr_FR) it's "Le numéro IBAN saisi n'est pas valide (International Bank Account Number)." |
Updated! |
@sprain You can use in PHPStrom: |
Thank you for this implementation! Could you please add tests for the null and empty string cases? (see the other validator tests) Also, as was said, please fix the indentation. |
Thanks for the feedback. |
@@ -222,6 +222,10 @@ | |||
<source>Unsupported card type or invalid card number.</source> | |||
<target>Nicht unterstützer Kartentyp oder ungültige Kartennummer.</target> | |||
</trans-unit> | |||
<trans-unit id="59"> | |||
<source>This is not a valid International Bank Account Number (IBAN).</source> | |||
<target>Dieser Wert ist keine gültige IBAN-Kontonummer.</target> |
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.
Wrong indention. Maybe tabs vs spaces
@sprain What's the status of this PR? Can you take the comments into account? |
Thanks for the reminder! I just pushed an update. Hope things are fine now. |
Exactly what I needed. |
Until merged: |
/** | ||
* @Annotation | ||
* | ||
* @api |
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.
please remove @api
as it will be decided later
Hi, any updates on this one? Adding these would be quite usefull for a couple of projects... Thanks! |
@kimausloos You can use the SprainValidator has a seperate extension until then |
@AAtticus Thanks, that's the plan but it would be nice if I wouldn't have to add an extra bundle as they impact speed and memory usage :) |
Validation for International Bank Account Numbers
This PR was merged into the master branch. Discussion ---------- [Form] [Validator] Added IBAN validator Bug fix: no Feature addition: yes Backwards compatibility break: no License of the code: MIT Validation for International Bank Account Numbers http://en.wikipedia.org/wiki/International_Bank_Account_Number I don't know if the community likes new validators. I have been using this in many projects and would love to see it integrated directly with Symfony. Commits ------- c8906f4 [Validator] Added IBAN validator
According to the news items on the following page it seems that there have been a lot of changes due to country specific differences. https://code.google.com/p/php-iban/ Should Symfony's Iban Validator be adjusted to that? |
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
License of the code: MIT
Validation for International Bank Account Numbers
http://en.wikipedia.org/wiki/International_Bank_Account_Number
I don't know if the community likes new validators. I have been using this in many projects and would love to see it integrated directly with Symfony.