Skip to content

Add support for Nigeria's 11-character postcodes - #25

Merged
BenMorel merged 1 commit into
brick:mainfrom
Adeniyikayodee:ng-digital-postcode
Oct 9, 2026
Merged

BenMorel merged 1 commit into
brick:mainfrom
Adeniyikayodee:ng-digital-postcode

Conversation

@Adeniyikayodee

Copy link
Copy Markdown
Contributor

NIPOST launched a new postcode for Nigeria in October 2026. It has 11 characters in five segments, for example EK-01-A03-FK-01: two letters, two digits, three letters or digits, two letters, and two digits. The two numeric segments run from 01 to 99.

NGFormatter accepted six digits only, so every new code was rejected. It now accepts both and formats the new code with hyphens, which is how NIPOST writes it. Six-digit codes are unchanged.

Format reference: https://docs.postcode.gov.ng/concepts/postcode-format

PHPUnit and PHPStan pass locally.

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.21%. Comparing base (bd00669) to head (87e47a7).

Additional details and impacted files
@@            Coverage Diff            @@
##               main      #25   +/-   ##
=========================================
  Coverage     99.21%   99.21%           
- Complexity      502      503    +1     
=========================================
  Files           186      186           
  Lines          1019     1022    +3     
=========================================
+ Hits           1011     1014    +3     
  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.

@Adeniyikayodee

Copy link
Copy Markdown
Contributor Author

The Coding Standard job fails at composer install: squizlabs/php_codesniffer 4.0.1 is now blocked by a security advisory, so the check stops before it reads the code. The PHPUnit and PHPStan jobs pass. Happy to rebase once the tool is updated.

@Adeniyikayodee

Copy link
Copy Markdown
Contributor Author

@BenMorel, I would be grateful if you could look at this whenever your time allows. Nigeria launched a new national postcode on 1 October, and the NG formatter still accepts only the six-digit code it replaces, so every new code is rejected. The format and its source are in the description, and the tests cover each segment. I am glad to change anything that would make this easier to merge. Thank you for maintaining this library, and please take it at your own pace.

@Adeniyikayodee

Copy link
Copy Markdown
Contributor Author

A short update on the failing Coding Standard job: I ran ecs check locally with the same brick/coding-standard v4 config, and it reports no errors on src and tests for this branch. The job itself still stops at composer install for the reason above.

@BenMorel
BenMorel merged commit 24b3816 into brick:main Oct 9, 2026
8 of 9 checks passed
@BenMorel

BenMorel commented Oct 9, 2026

Copy link
Copy Markdown
Member

Thank you, @Adeniyikayodee!

The coding standard job has been fixed on main since.

@BenMorel

BenMorel commented Oct 9, 2026

Copy link
Copy Markdown
Member

Released as 0.6.3.

@Adeniyikayodee

Copy link
Copy Markdown
Contributor Author

Thank you, @BenMorel, for the merge and the quick release.

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