PHPackages                             codelibrary/world - 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. codelibrary/world

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

codelibrary/world
=================

List of countries and their associated data.

v0.2.2(1y ago)017MITPHPPHP ^8.2

Since Jun 12Pushed 1y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

CodeLibrary / World
===================

[](#codelibrary--world)

PHP package as service for endpoint resource of countries and their associated data.

Installation
------------

[](#installation)

Add this package directly with composer:

```
composer require codelibrary/world
# or
composer require codelibrary/world -n # --no-interaction (Docker SSH reasons)
```

Build and run for dev environment
---------------------------------

[](#build-and-run-for-dev-environment)

The `docker build` command will copy the local content to the container. So use `docker run -v` (or `--volume`) option to bind with local content:

```
cd /path/to/project/
docker build -t [IMAGE_NAME] .
docker run -d -v .:/var/www/html --name [NEW_CONTAINER_NAME] [IMAGE_NAME]
docker exec -it [NEW_CONTAINER_NAME] /bin/bash
```

Usage
-----

[](#usage)

```
use CodeLibrary\World\CountryFinder;

// optional params
$extraCountryData = [
    [
        'name' => ['official' => 'Hellenic Republic'], // already existing key
        'altSpellings' => ['hellenicccccccc'], // new custom values
    ],
    [
        'name' => ['official' => 'Kingdom of Spain'],
        'altSpellings' => ['The Kingdom of Spain'],
    ],
];

$finder = new CountryFinder($extraCountryData);

$finder->name('invalid country name here'); // throw 'InvalidCountryNameException'

$country1 = $finder->name('Hellenicccccccc');
$country2 = $finder->name('the kingdom of spain');

$country2->hasName('spain'); // (bool) true
$country2->hasName('spain, the kindom of'); // (bool) false
echo $country2->name('fra'); // Royaume d'Espagne
echo $country2->nameCommon('fra'); // Espagne
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for details.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Security
--------

[](#security)

If you discover any security related issues, please email to  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nikola Zeravcic](https://github.com/zeravcic)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance48

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~80 days

Total

5

Last Release

382d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f323ed212f50a4035758f59d096b11fc9cb0430ea7d511ae092772367ebba0e?d=identicon)[codelibrary](/maintainers/codelibrary)

---

Top Contributors

[![zeravcic](https://avatars.githubusercontent.com/u/7994942?v=4)](https://github.com/zeravcic "zeravcic (14 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/codelibrary-world/health.svg)

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

###  Alternatives

[altis/roles-to-taxonomy

WordPress plugin to store user roles and user levels in a taxonomy, for performance.

9444.9k](/packages/altis-roles-to-taxonomy)

PHPackages © 2026

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