Download the PHP package labrodev/postal-formatter without Composer
On this page you can find all versions of the php package labrodev/postal-formatter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download labrodev/postal-formatter
More information about labrodev/postal-formatter
Files in labrodev/postal-formatter
Package postal-formatter
Short Description PHP utility library that provides robust formatting for European postal codes, following official formatting standards country-by-country.
License MIT
Homepage https://github.com/labrodev/postal-formatter
Informations about the package postal-formatter
PHP Postal Formatter
Labrodev\PostalFormatter is a strict PHP 8.1+ utility library that provides robust formatting for European postal codes, following official formatting standards country-by-country.
Features
- Cleans and standardizes postal codes (removes spaces, symbols, lowercases)
- Supports most of the European countries (45+ ISO 3166-1 alpha-2 codes)
- Automatically formats codes to the standard of each country (e.g.
12345
→123 45
for CZ,sw1a1aa
→SW1A 1AA
for GB) - Ready-to-go static formatter
- Fully typed with strict mode (
declare(strict_types=1)
) - Includes PHPUnit and PHPStan support for testing and analysis
Installation
Usage
List of available country codes you may find in CountryCode Enum (Labrodev/PostalFormatter/Enums/CountryCode).
Testing
To run tests:
Static Analysis
To run static analysis using PHPStan:
Configuration is located in
phpstan.neon.dist
Security
If you discover a security vulnerability within this package, please contact us immediately at [email protected]. All security-related issues will be handled privately and promptly.
Credits
This package is maintained by Labrodev — Laravel & PHP development studio.
https://github.com/labrodev
Feedback
If you have any questions, suggestions, or have found an error — feel free to open an issue or contact us:
📬 [email protected]
License: MIT