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
[Intl] Add support for ISO 3166-1 numeric codes #51073
Conversation
Hey! Thanks for your PR. You are targeting branch "6.4" but it seems your PR description refers to branch "5.4". Cheers! Carsonbot |
'ZW' => '716', | ||
'ZZ' => '999', | ||
], | ||
'NumericToAlpha2' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the best way to handle these numeric strings with leading zeros as array keys - we have a mix of int and string keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps sanitize all to string?
'ZW' => '716', | ||
'ZZ' => '999', | ||
], | ||
'NumericToAlpha2' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps sanitize all to string?
964 => 'QR', | ||
965 => 'QS', | ||
966 => 'QT', | ||
'QV', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this normal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've forced all the array keys to be numeric strings, prefixed with an underscore, to stop PHP trying to convert string numbers such as '077' to (int) 77.
09deecd
to
cde4f83
Compare
ff2b253
to
d2cbeb5
Compare
Unit test failures appear to be unrelated to the PR. |
d2cbeb5
to
9c071c6
Compare
9c071c6
to
f93a3c8
Compare
f93a3c8
to
972acf2
Compare
Thank you @benr77. |
…nr77) This PR was merged into the 6.4 branch. Discussion ---------- [Intl] Document support for ISO 3166-1 numeric codes To accompany PR * symfony/symfony#51073 Commits ------- a9da7e0 Document support for ISO 3166-1 numeric codes
Add support for ISO-3166-1 numeric codes.
As well as the existing Alpha2 and Alpha3 codes, this PR adds support for the numeric country codes as per https://www.iso.org/obp/ui/#search/code/.