PHPackages                             devysm/enum-mapper - 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. devysm/enum-mapper

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

devysm/enum-mapper
==================

Map the enum values in short codes with enum mapper class.

472PHP

Since Aug 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/DevYSM/enum-mapper)[ Packagist](https://packagist.org/packages/devysm/enum-mapper)[ RSS](/packages/devysm-enum-mapper/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Enum Mapper
===========

[](#enum-mapper)

With enum mapper, you can map your enum classes easily with some of the features. I will explain these features in the following commands.

Map your enum class with Enum mapper class.
-------------------------------------------

[](#map-your-enum-class-with-enum-mapper-class)

Add badges from somewhere like: [shields.io](https://shields.io/)

[![MIT License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://choosealicense.com/licenses/mit/)[![GPLv3 License](https://camo.githubusercontent.com/da9c3abfd62c32a94031c3a382cb7c85dbd4cede411416837adfe6b8fda05ba1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c25323076332d79656c6c6f772e737667)](https://opensource.org/licenses/)[![AGPL License](https://camo.githubusercontent.com/aed477ac82de60abd644cfa7c9d381eebe9a00d5d32168644f7e6d2a23957d1b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4147504c2d626c75652e737667)](http://www.gnu.org/licenses/agpl-3.0)

You can install the package via composer using the following command.
---------------------------------------------------------------------

[](#you-can-install-the-package-via-composer-using-the-following-command)

```
  composer require devysm/enum-mapper
```

Usage/Examples
--------------

[](#usageexamples)

```
use Devysm\EnumMapper\EnumMapper;

$mapper = new EnumMapper();

// This method will return a single array of cassess, Check the next example
$mapper->setEnum(\App\Enum\OriginEnum::class)->getCasesWithoutContext();

[
  0 => "italy"
  1 => "china"
  2 => "turkey"
  3 => "germany"
  4 => "qatar"
  5 => "taiwan"
  6 => "japan"
]

// This method will return a single array of cassess
// with keys like the original value of case, Check the next example.
$mapper->setEnum(\App\Enum\OriginEnum::class)->getCasesWithContext();
[
  "italy" => "Italy"
  "china" => "China"
  "turkey" => "Turkey"
  "germany" => "Germany"
  "qatar" => "Qatar"
  "taiwan" => "Taiwan"
  "japan" => "Japan"
]

// also you can change the context data to lowercase & uppercase
// Check the next example

$mapper->setEnum(\App\Enum\OriginEnum::class)
        ->toLowercase()
        ->getCasesWithContext();

$mapper->setEnum(\App\Enum\OriginEnum::class)
->toUppercase()
->getCasesWithContext();
```

Authors
-------

[](#authors)

- [@Yassen Sayed](https://www.github.com/DevYSM)

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

18

—

LowBetter than 7% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/94ad099ac29460710c50f3c27489ebd2e8ee24d3cd5bfbaf040cd5d4a3a2dd1a?d=identicon)[Yassen Sayed](/maintainers/Yassen%20Sayed)

---

Top Contributors

[![DevYSM](https://avatars.githubusercontent.com/u/59166666?v=4)](https://github.com/DevYSM "DevYSM (1 commits)")

### Embed Badge

![Health badge](/badges/devysm-enum-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/devysm-enum-mapper/health.svg)](https://phpackages.com/packages/devysm-enum-mapper)
```

PHPackages © 2026

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