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

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

enderive/enum
=============

Enum implementation for php below 8.1

1.0.1(2y ago)08MITPHP

Since Feb 1Pushed 2y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Enum implementation for php &lt; 8.1
====================================

[](#enum-implementation-for-php--81)

### Class designed to behave as close to native php enum as possible.

[](#class-designed-to-behave-as-close-to-native-php-enum-as-possible)

```
use Enderive\Enum;

/**
 * Pure enum
 *
 * @method static UserStatus ADMIN()
 * @method static UserStatus MEMBER()
 * @method static UserStatus GUEST()
*/
class UserStatus extends Enum {}

/**
 * Backed enum
*/
class UserStatus extends Enum
{
    private const ADMIN = 1;
    private const MEMBER = 2;
    private const GUEST = 3;
}

UserStatus::ADMIN();
UserStatus::from(1);
UserStatus::tryFrom(1);
UserStatus::cases();

// Enums are singletons
UserStatus::ADMIN() === UserStatus::ADMIN() // => true

$status = UserStatus::from(1);
$status->name // "ADMIN"
$status->value // 1
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Total

2

Last Release

835d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3794c2412abb29d444413994d9d45f3cf17e1107876aaa5bb0df3574017fffe?d=identicon)[enderive](/maintainers/enderive)

---

Top Contributors

[![enderive](https://avatars.githubusercontent.com/u/156367404?v=4)](https://github.com/enderive "enderive (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mpociot/reflection-docblock

8515.6M51](/packages/mpociot-reflection-docblock)

PHPackages © 2026

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