Skip to content

Fix outdated administrative districts in zh_TW provider - #1063

Open
cscolabear wants to merge 2 commits into
FakerPHP:2.0from
cscolabear:agent/update-zh-tw-administrative-districts
Open

Fix outdated administrative districts in zh_TW provider#1063
cscolabear wants to merge 2 commits into
FakerPHP:2.0from
cscolabear:agent/update-zh-tw-administrative-districts

Conversation

@cscolabear

Copy link
Copy Markdown

What is the reason for this PR?

The zh_TW address provider contains four outdated or incorrect Taiwanese administrative district entries.

Applications that match generated addresses against current postal-code or government datasets can fail when Faker returns these obsolete values. This was observed in a downstream test suite where an obsolete district name could not be mapped to a current postal code.

This is a locale data correction only. It does not change any public formatter, API, or address format.

  • A new feature
  • Fixed an issue

Author's checklist

Summary of changes

  • Replace 苗栗縣頭份鎮 with 苗栗縣頭份市.

  • Replace 彰化縣員林鎮 with 彰化縣員林市.

  • Replace the former Tainan 中區 and 西區 entries with 中西區.

  • Replace the duplicate Kaohsiung 三民區 entry representing the former Sanmin Township with 那瑪夏區.

  • Add deterministic regression tests that:

    • verify the current district names are present;
    • verify the obsolete district names are absent;
    • detect duplicate districts within each county or municipality.

Official references

Validation

The following commands completed successfully:

  • make cs
  • make test

Regression coverage was added in:

  • test/Provider/zh_TW/AddressTest.php

The tests verify both the expected replacements and the absence of duplicate administrative districts.

Compatibility impact

This PR intentionally changes four values that may be generated by the zh_TW provider.

Applications, snapshots, or seeded fixtures that explicitly expect the obsolete district names may observe different generated values. However, the replacements reflect the current official administrative divisions and improve compatibility with current postal-code and government datasets.

No formatter, API, address structure, or random-generation behavior is changed.

Review focus

The functional change is limited to:

  • src/Provider/zh_TW/Address.php
  • test/Provider/zh_TW/AddressTest.php

The main review points are:

  1. Whether the four replacements accurately reflect Taiwan's current administrative divisions.
  2. Whether the regression test follows the preferred conventions for locale-provider tests on the 2.0 branch.

Backport

The same obsolete data exists in the 1.24 branch and affects projects using fakerphp/faker v1.24.1.

Review checklist

  • All checks have passed
  • Changes are added to the CHANGELOG.md
  • Changes are approved by maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants