PHPackages                             mibo/countries - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mibo/countries

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mibo/countries
==============

PHP Library for ISO 3166-1 country codes

2.0.0(1y ago)05.7k↓34.6%[1 PRs](https://github.com/4513/countries/pulls)1MITPHPPHP ^8.2CI passing

Since Dec 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/4513/countries)[ Packagist](https://packagist.org/packages/mibo/countries)[ RSS](/packages/mibo-countries/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (10)Versions (3)Used By (1)

Countries
=========

[](#countries)

[![codecov](https://camo.githubusercontent.com/a9f79af15e0f9c8891b319a124c70d33639c0cfba47cef7939bbd4492f96408f/68747470733a2f2f636f6465636f762e696f2f67682f343531332f636f756e74726965732f67726170682f62616467652e7376673f746f6b656e3d476b34624a38414b684a)](https://codecov.io/gh/4513/countries)

*mibo/countries*

The library provides a simple interface for a country entity and country provider, which retrieves a country by its ISO 3166-1 alpha-2 code, alpha-3 code, or numeric code. The provider is able to retrieve a country by its name, too.
If the provider does not find the country, it returns a null.

The Country entity contains its name, ISO 3166-1 alpha-2 code, alpha-3 code, numeric code, and the country's currencies (objects).

The list of the available countries can be changed by the provider, because the library (ISO) provider uses a provider from 'league/iso3166' library, which provides the same data but as array instead.

```
$provider = new \MiBo\Countries\ISO\CountryProvider(
    new \League\ISO3166\ISO3166($myCountryList ?? []),
    new \MiBo\Currencies\ISO\ISOCurrencyProvider(
        new \MiBo\Currencies\ISO\ISOArrayListLoader(),
        new \Psr\Log\NullLogger()
    )
)

$country = $provider->getByAlpha2('SK');

echo $country->getName(); // Slovakia
echo $country->getAlpha2(); // SK
echo $country->getAlpha3(); // SVK
echo $country->getNumericalCode(); // 703
echo $country->getCurrencies()[0]; // EUR
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance65

Regular maintenance activity

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~238 days

Total

2

Last Release

648d ago

Major Versions

1.0.0 → 2.0.02024-08-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/0866c3280ed62cfc74feb086241ec9ee56bab89b4fa2b8c8a3dbd62508761b6a?d=identicon)[MiBo](/maintainers/MiBo)

---

Top Contributors

[![4513](https://avatars.githubusercontent.com/u/25705559?v=4)](https://github.com/4513 "4513 (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

countriescountrycountry-codesisoiso-3166iso-3166-1phppackagelibrarycountriesISO 3166iso31663166-1standardcountrylibcodescountry codesMiBo

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mibo-countries/health.svg)

```
[![Health](https://phpackages.com/badges/mibo-countries/health.svg)](https://phpackages.com/packages/mibo-countries)
```

###  Alternatives

[league/iso3166

ISO 3166-1 PHP Library

69536.3M116](/packages/league-iso3166)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)[niiknow/bayes

a machine learning lib

6950.0k](/packages/niiknow-bayes)[thalidzhokov/country-codes

CountryCodes PHP Class to get array of countries with ISO 3166-1 alpha-2, ISO 3166-1 alpha-3, ISO 3166-1 numeric and ISD codes it can provide following information related to country

13111.5k](/packages/thalidzhokov-country-codes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
