erickskrauch / mcc-mnc
A library to convert MCC to country code and vice-versa
Requires
- php: ^7.4 || ^8.0
Requires (Dev)
- ely/php-code-style: ^0.5.0
- ergebnis/composer-normalize: ^2.28
- nette/php-generator: ^3.6
- phpunit/phpunit: ^9.6
- symfony/dom-crawler: ^5.4
This package is auto-updated.
Last update: 2024-10-16 16:46:15 UTC
README
I couldn't find any existing libraries with MCC identifiers map to their according country. So I made my own. The data is parsed from this wikipedia table.
A very rough implementation, but it does exactly what I needed for my job. Feel free to open an issue with your feature request.
Installation
To use this library, require it in Composer:
composer require erickskrauch/mcc-mnc
Usage
$countryCode = \ErickSkrauch\MccMnc\Reference::countryFromMcc(260); // 'PL' $mcc = \ErickSkrauch\MccMnc\Reference::mccFromCountry('US'); // 312
Contribute
This library in an Open Source under the MIT license. It is, thus, maintained by collaborators and contributors.
Feel free to contribute in any way. As an example you may:
- Trying out the
master
code. - Create issues if you find problems.
- Reply to other people's issues.
- Review PRs.
Ensuring code quality
The project has several tools for quality control. All checks are performed in CI, but if you want to perform checks locally, here are the necessary commands:
composer normalize vendor/bin/php-cs-fixer fix -v vendor/bin/phpunit