Skip to content

Restrict Greenland postcodes to the 39NN range - #31

Open
PierreQueyroi wants to merge 1 commit into
brick:mainfrom
PierreQueyroi:gl-39xx-postcodes
Open

PierreQueyroi wants to merge 1 commit into
brick:mainfrom
PierreQueyroi:gl-39xx-postcodes

Conversation

@PierreQueyroi

Copy link
Copy Markdown

Greenland is part of the Danish postcode system and uses the 3900–3999 range. GLFormatter accepted any four digits, so values such as 1234 or 1448 (Copenhagen K) passed as Greenland postcodes.

It now requires 39NN, the same way GPFormatter requires 971NN. The data provider gains 3900 and 3999 as valid and 1234, 3899, 4000 as invalid; 1234 was accepted before.

Santa Claus's 2412 is left out, as in Google's data: it is a single novelty code outside the range.

Sources:

How this was found: an AI-assisted comparison between this library and the JavaScript library postcode-validator, run over candidate postcodes generated from both rule sets, listed every country where the two disagree. Each disagreement is then checked against postal sources, and the ones where this library is wrong become a PR, one country at a time. Here postcode-validator already requires 39NN.

PHPUnit, PHPStan and ECS pass locally.

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.21%. Comparing base (4c9484d) to head (a5b7d60).

Additional details and impacted files
@@            Coverage Diff            @@
##               main      #31   +/-   ##
=========================================
  Coverage     99.21%   99.21%           
  Complexity      503      503           
=========================================
  Files           186      186           
  Lines          1022     1022           
=========================================
  Hits           1014     1014           
  Misses            8        8           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant