odolbeau / phone-number-bundle

Integrates libphonenumber into your Symfony application
MIT License
215 stars 43 forks source link

Validator cannot be instantiated #170

Closed KatzoArano closed 5 months ago

KatzoArano commented 5 months ago

Hi, On a Sylius project (with Symfony 5.4) I get an issue during my project launch : Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber::__construct(): Argument #1 ($format) must be of type ?int, array given

KatzoArano commented 5 months ago

https://github.com/odolbeau/phone-number-bundle/blob/67ee847f81957bdc909f681ff9f578231eed8cfa/src/Validator/Constraints/PhoneNumber.php#L56-L71

Previously, on 3.10.0 version, the constructor accepted an array as format. On my project the constructor receives an array, so if I change the $format type to mixed $format I have no errors.

maxhelias commented 5 months ago

Hi @KatzoArano !

Yes, since https://github.com/odolbeau/phone-number-bundle/pull/162 because it was legacy code linked to the annotation which is now better managed as an attribute. And I see that I made a mistake during the release. 3.10.1 shouldn't exist but rather 4.0.0 to avoid this incompatibility.

maxhelias commented 5 months ago

3.10.1 has been remove and I created the new one : https://github.com/odolbeau/phone-number-bundle/releases/tag/v4.0.0

maxhelias commented 5 months ago

Zorte on 😉

KatzoArano commented 5 months ago

OK, thanks for your feedback , Milesker @maxhelias eta laster arte ;-)