PHPackages                             manchenkov/php-enum - 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. manchenkov/php-enum

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

manchenkov/php-enum
===================

Enumeration type - PHP implementation with useful magic methods

0.0.2(5y ago)14MITPHPPHP ^7.4

Since May 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/manchenkoff/php-enum)[ Packagist](https://packagist.org/packages/manchenkov/php-enum)[ RSS](/packages/manchenkov-php-enum/feed)WikiDiscussions master Synced 1w ago

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

PHP Enum
========

[](#php-enum)

Basic enumeration implementation in PHP, easy and ready to use.

- *Enum*: to create simple enumeration class
- *StrictEnum*: to create enumeration with strict variables type

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

[](#installation)

You have to run following command to add a dependency to your project

```
composer require manchenkov/php-enum
```

or you can add this line to `require` section of `composer.json`

```
"manchenkov/php-enum": "*"

```

How to use
----------

[](#how-to-use)

Create a new class like `UserType.php` and paste the following code example:

```
use Manchenkov\Enumeration\Enum;

/**
 * @method static UserType MANAGER()
 * @method static UserType ADMIN()
 */
class UserType extends Enum
{
    /**
     * @title Manager role description
     */
    private const MANAGER = 'user_manager';

    /**
     * @title Administrator role description
     */
    private const ADMIN = 'user_admin';
}
```

Now You can create a new instance of `UserType` enumeration and work with some methods:

```
$manager = UserType::MANAGER();

$manager->getName(); // MANAGER
$manager->getValue(); // user_manager
$manager->getTitle(); // Manager role description

$manager->is(UserType::ADMIN()); // false
$manager->eq('user_manager'); // true
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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 ~135 days

Total

2

Last Release

2049d ago

PHP version history (2 changes)0.0.1PHP ^7.2

0.0.2PHP ^7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6690063?v=4)[Artem Manchenkov](/maintainers/manchenkoff)[@manchenkoff](https://github.com/manchenkoff)

---

Tags

enumenumerationlaraveloopphpphp-libraryphp7yii2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/manchenkov-php-enum/health.svg)

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

###  Alternatives

[liorchamla/faker-prices

Provides typical and credible prices for Faker (fzaninotto/faker or fakerphp/faker) library

1226.9k](/packages/liorchamla-faker-prices)[kx1000/kwota-slownie

Kwota słownie

1016.6k1](/packages/kx1000-kwota-slownie)

PHPackages © 2026

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