v2.3.0
Address formats now declare which fields have subdivision data
subdivision_depth has been replaced by subdivision_data_fields, which names the fields directly instead of encoding them as a count (#213):
// Before: 1 meant "administrative areas", 2 meant "administrative areas and localities".
'subdivision_depth' => 1,
// After.
'subdivision_data_fields' => ['administrativeArea'],AddressFormat now has getSubdivisionDataFields(), replacing getSubdivisionDepth() which is now deprecated. Custom definitions using subdivision_depth are still accepted and converted automatically.
New subdivisions
- Great Britain — the 217 counties from ISO 3166-2:GB, keyed by ISO code, with Welsh names as translations
- Guatemala — the 22 departments, contributed by @jgalindosl (#242).
Data corrections
- AE - optional city field added; the missing hamza restored in the Umm Al Quwain local name.
- CO - spelling of Guainía.
- IT - province list updated and sorted alphabetically, thanks to @McAle16 (#237).
- NG-— the
Statesuffix dropped from Ogun. - PE - administrative areas are now labelled as regions, matching ISO 3166-2:PE.
- RU - the Udmurt Republic now uses its official name.
- TH - romanization fixed for Chumphon, Phatthalung and Suphan Buri; the changwat prefix
dropped from the Bueng Kan local name. - TR - Afyon renamed to Afyonkarahisar.
- VE -
Distrito Federalrenamed toDistrito Capital, its official and ISO 3166-2 name since
1999; La Guaira moved to its alphabetical position after the rename from Vargas. - VN - the city prefix dropped from the Ho Chi Minh local name.
Other improvements
- Reworked DefaultFormatter's logic for rendering empty fields, fixing bugs where separators
were sometimes left behind (affecting CO, GT, JP, MX, PY, TR, UY, VE). - Subdivision definitions with a
localenow defaultlocal_nametoname, for less verbosity. - Malformed subdivision definition files are ignored instead of raising errors (#246).
PostalCodeHelperaccepts modifiers in regular expression rules, so/ZE[0-9]/iworks (#164).doctrine/collections3 is now allowed, thanks to @Chris53897 (#241).SubdivisionUpdatermappings for Vietnam now matchVN.json, thanks to @eugene-brit (#240), and cover the VN renames shipped in v2.2.5.
Full Changelog: v2.2.5...v2.3.0