Skip to content

[Validator] Some countries are missing #58126

@tugrul

Description

@tugrul

Symfony version(s) affected

6.4.10

Description

Some countries are not included and IbanValidator warns.

How to reproduce

Try to submit this iban MN140005005163847716.

<?php
namespace App\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;

class IbanValidatorFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('iban', TextType::class, [
                'label' => 'iban',
                'constraints' => [
                    new Assert\Iban()
                ],
                'attr' => [
                    'placeholder' => 'enter_your_iban_here'
                ]
            ])
            ->add('submit', SubmitType::class, [
                'label' => 'validate'
            ])
        ;
    }
}

Possible Solution

I see there is an update script Resources/bin/sync-iban-formats.php. The list will possibly updated when the script executed.

Additional Context

No response

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