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

ActiveLibrary

teabugger/enum
==============

PHP ENUM implementation

v1.0(5y ago)03MITPHPPHP ^7.4

Since Sep 27Pushed 5y ago1 watchersCompare

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

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

Enum
====

[](#enum)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2211dcf4c7167ecc0880deb27ce9ed30834fef5ee7d6357a1eba5465ac351571/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7465616275676765722f656e756d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/teabugger/enum)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/505f3a1ee2bf0dcaa3dc455bd533fa0cb1b8febbed18ac5d8bb5d2e76bd26cc1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7465616275676765722f656e756d2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/teabugger/enum)[![Coverage Status](https://camo.githubusercontent.com/3caed7afd861d6aa3a58008ac7421e494622cf36ba6ad4de2f4f427a7fe491bd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7465616275676765722f656e756d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/teabugger/enum/code-structure)[![Quality Score](https://camo.githubusercontent.com/28643d1a8e7524e3e205f33b87d6a9a750b59e628f195041ad4524354fa89fc3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7465616275676765722f656e756d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/teabugger/enum)[![Total Downloads](https://camo.githubusercontent.com/6ffc264afe6acd5a7f177d4e56ce2f41dd0abdb0429c274d4b65105665fa1179/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7465616275676765722f656e756d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/teabugger/enum)

Install
-------

[](#install)

Via Composer

```
$ composer require teabugger/enum
```

Usage
-----

[](#usage)

```
use Teabugger/Enum;

class MyEnum extends Enum
{
    public const FOO = 'foo';
    public const BAR = 'bar';
}

$foo = new MyEnum(MyEnum::FOO);
// (string) $foo === 'foo';
```

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

[](#change-log)

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

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Maksim Kolesnik](https://github.com/teabugger)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

2059d ago

### Community

Maintainers

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

---

Top Contributors

[![teabugger](https://avatars.githubusercontent.com/u/12287141?v=4)](https://github.com/teabugger "teabugger (13 commits)")

---

Tags

enumteabugger

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[myclabs/php-enum

PHP Enum implementation

2.7k227.9M637](/packages/myclabs-php-enum)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[dasprid/enum

PHP 7.1 enum implementation

382146.0M11](/packages/dasprid-enum)[spatie/enum

PHP Enums

84529.1M68](/packages/spatie-enum)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49644.8M97](/packages/marc-mabe-php-enum)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)

PHPackages © 2026

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