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

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

aeviiq/enum
===========

Enum Component

v4.0(2y ago)217.3k↑43.3%11MITPHPPHP ^8.1

Since Jun 8Pushed 2y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (7)Versions (9)Used By (1)

Enum Component
==============

[](#enum-component)

Why
---

[](#why)

To provide a way to implement enum flags in PHP.

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

[](#installation)

```
composer require aeviiq/enum

```

Declaration
-----------

[](#declaration)

```
final class Foo extends AbstractFlag
{
    public const BAR = 1;
    public const BAZ = 2;
    // ...
}
```

Usage
-----

[](#usage)

```
$foo = new Foo(Foo:BAR);
$foo->contains(new Foo(Foo:BAR)); // True
$foo->contains(new Foo(Foo:BAZ)); // False
$foo->contains(new Bar(Foo::BAR)); // InvalidArgumentException thrown
$foo = new Foo(6); // UnexpectedValueException thrown
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity73

Established project with proven stability

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

Recently: every ~395 days

Total

8

Last Release

933d ago

Major Versions

v1.0 → v2.02019-08-17

2.0.x-dev → 3.0.x-dev2021-10-26

v3.0 → 4.0.x-dev2023-12-14

PHP version history (3 changes)1.0.x-devPHP ^7.2

3.0.x-devPHP ^7.2 || ^8.0

4.0.x-devPHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34397049?v=4)[aeviiq](/maintainers/aeviiq)[@aeviiq](https://github.com/aeviiq)

---

Top Contributors

[![aeviiq](https://avatars.githubusercontent.com/u/34397049?v=4)](https://github.com/aeviiq "aeviiq (20 commits)")

---

Tags

enumflagsphp-enumbitwise

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[myclabs/php-enum

PHP Enum implementation

2.7k236.1M695](/packages/myclabs-php-enum)[dasprid/enum

PHP 7.1 enum implementation

382165.7M12](/packages/dasprid-enum)[spatie/enum

PHP Enums

85232.6M75](/packages/spatie-enum)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

50458.3M110](/packages/marc-mabe-php-enum)[oskarstark/enum-helper

This library provides helpers for several enum operations

143.9M32](/packages/oskarstark-enum-helper)[zlikavac32/php-enum

Better PHP enum support

225.7k5](/packages/zlikavac32-php-enum)

PHPackages © 2026

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