Skip to content
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

[Validator] BicValidator add strict mode to validate bics in strict mode #54879

Open
wants to merge 1 commit into
base: 7.2
Choose a base branch
from

Conversation

maxbeckers
Copy link
Contributor

@maxbeckers maxbeckers commented May 10, 2024

Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #54822
License MIT

Add a strict mode for bic validation (default strict, behavior before the pr is strict). But it is possible to set strict to false to allow lowercase input.

I'll add it to the docs when this PR is merged.

@xabbuh
Copy link
Member

xabbuh commented May 10, 2024

What about adding a normalizer option like in e.g. the Email or Ip constraints?

@maxbeckers maxbeckers force-pushed the patch-54822_bic_strict_validation branch 2 times, most recently from c460395 to 1b7bc67 Compare May 13, 2024 06:09
// should contain uppercase characters only
if (strtoupper($canonicalize) !== $canonicalize) {
// should contain uppercase characters only in strict mode
if (Bic::VALIDATION_MODE_STRICT === $constraint->mode && strtoupper($canonicalize) !== $canonicalize) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh I changed it now to mode, the way that was also done in the email validator, because i need id here for the check. With the normalizer way i wouldn't know to check this or not.

@maxbeckers maxbeckers force-pushed the patch-54822_bic_strict_validation branch from 1b7bc67 to a28b5e6 Compare May 15, 2024 07:11
@fabpot fabpot added this to the 7.2 milestone May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BicValidator/IbanValidator value normalization
3 participants