If the widget PhoneNumberType::WIDGET_COUNTRY_CHOICE is used, the number in the number form type contains leading zeros. In the context of the select form type of the region code this is unexpected: +49 02408 95660 instead of +49 2408 95660
Currently the PhoneNumberToArrayTransformer uses
'number' => $util->format($phoneNumber, PhoneNumberFormat::NATIONAL),
Perhaps the better way is to strip the leading zeros:
If the widget PhoneNumberType::WIDGET_COUNTRY_CHOICE is used, the number in the number form type contains leading zeros. In the context of the select form type of the region code this is unexpected: +49 02408 95660 instead of +49 2408 95660
Currently the PhoneNumberToArrayTransformer uses
'number' => $util->format($phoneNumber, PhoneNumberFormat::NATIONAL),
Perhaps the better way is to strip the leading zeros:
'number' => $this->getNationalNumberForRegionCodeContext($util->format($phoneNumber, PhoneNumberFormat::NATIONAL), $phoneNumber),
Other numbers perhabs for unit tests: +43533765123 +41625571123 +390669812123 (hasItalianLeadingZero) +390863530123 +39393508123