erickskrauch/mcc-mnc

A library to convert MCC to country code and vice-versa

0.2.0 2023-04-30 23:57 UTC

This package is auto-updated.

Last update: 2024-05-16 15:48:11 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.

Latest Version on Packagist Build Status Changelog PHP version Software License

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