Skip to content

[Validator] Validate BIC based on associated IBAN #28166

Closed
@sylfabre

Description

@sylfabre

Description
A common use case is to save an IBAN with a BIC. Symfony provides validators for both properties but they do not communicate.

We could add an optional propertyPath option (like http://symfony.com/doc/current/reference/constraints/GreaterThan.html#propertypath) on the BIC validator to check if the country code of the BIC is the same as the country code of the IBAN.

I can submit a PR if you want.

Example
For instance a user can fill a French IBAN with a German BIC which will pass both validators but a failure could be expected somewhere as it does not make sense to fill a form/entity like this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions