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

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

fast-forward/enum
=================

Ergonomic utilities for PHP enums, including names, values, lookups, and option maps.

v0.1.0(1mo ago)0691MITPHPPHP ^8.3CI passing

Since Apr 24Pushed 1mo agoCompare

[ Source](https://github.com/php-fast-forward/enum)[ Packagist](https://packagist.org/packages/fast-forward/enum)[ Docs](https://github.com/php-fast-forward/enum)[ Fund](https://www.paypal.com/donate/?business=JLDAF45XZ8D84)[ GitHub Sponsors](https://github.com/sponsors/php-fast-forward)[ RSS](/packages/fast-forward-enum/feed)WikiDiscussions main Synced 1w ago

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

Fast Forward Enum
=================

[](#fast-forward-enum)

Ergonomic utilities and reusable catalogs for PHP enums, including names, values, lookups, maps, sorting helpers, and enum-driven workflows.

[![PHP Version](https://camo.githubusercontent.com/c9b19f1cbf8aefb8c278c8b5d392b64401164a08fced6ccbf376b32135d6714f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/releases/)[![Composer Package](https://camo.githubusercontent.com/621f878e76126e0fc8a3b04f060f73ddbcf93031c8aba335be29c203b8e6d85c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d666173742d2d666f7277617264253246656e756d2d4632384431412e7376673f6c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/fast-forward/enum)[![Tests](https://camo.githubusercontent.com/7004facc4c11cdbe16969b6166cfb8afa5ae842d87bb77c160207ad2eeb07140/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d666173742d666f72776172642f656e756d2f74657374732e796d6c3f6c6f676f3d676974687562616374696f6e73266c6f676f436f6c6f723d7768697465266c6162656c3d746573747326636f6c6f723d323243353545)](https://github.com/php-fast-forward/enum/actions/workflows/tests.yml)[![Coverage](https://camo.githubusercontent.com/783041b70aa9cfca2a0969ddc49e11178a3367b14165ef787853fdc3075f43b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d706870756e69742d3441444538303f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php-fast-forward.github.io/enum/coverage/index.html)[![Docs](https://camo.githubusercontent.com/18a5fcc120983d966be99e84aff4f3a926e848586fe1a3f0cd6e78b24c130f9f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6465706c6f796d656e74732f7068702d666173742d666f72776172642f656e756d2f6769746875622d70616765733f6c6f676f3d72656164746865646f6373266c6f676f436f6c6f723d7768697465266c6162656c3d646f6373266c6162656c436f6c6f723d31453239334226636f6c6f723d333842444638267374796c653d666c6174)](https://php-fast-forward.github.io/enum/index.html)[![License](https://camo.githubusercontent.com/0ab619a0a4a57cc10e41df2f267425483c6aba28c2c68574b79d7a822d003245/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7068702d666173742d666f72776172642f656e756d3f636f6c6f723d363437343842)](LICENSE)[![GitHub Sponsors](https://camo.githubusercontent.com/d61f432861a7c60e0a9620738dffd3b884bcf392c86e48a2cc87ea57a077e90a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f7068702d666173742d666f72776172643f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d776869746526636f6c6f723d454334383939)](https://github.com/sponsors/php-fast-forward)

[![Fast Forward Enum mascot banner](docs/_static/enum-mascot-banner.png)](docs/_static/enum-mascot-banner.png)

✨ Features
----------

[](#-features)

- 🧩 Traits for `values()`, `names()`, options, maps, lookups, and enum comparisons
- 🧭 `Helper\EnumHelper` for generic operations over `UnitEnum` and `BackedEnum`
- 🔄 Reversible sort-oriented enums such as `SortDirection`, `NullsPosition`, and `ComparisonResult`
- 🗂 Reusable catalogs grouped by domain, including `Calendar`, `Logger`, `Runtime`, and `DateTime`
- 🚦 Enum-based workflow transitions through `StateMachine\HasTransitions`
- 🏷 Optional `LabeledEnumInterface` and readable descriptions without framework lock-in
- 🧼 Small public API with explicit namespaces and no `Contracts` bucket

📦 Installation
--------------

[](#-installation)

```
composer require fast-forward/enum
```

Requirements:

- PHP `^8.3`

New to the package? Start with the [Quickstart](docs/getting-started/quickstart.rst), then use the [Usage guide](docs/usage/index.rst) when you want more complete examples.

🛠️ Usage
--------

[](#️-usage)

Basic enum ergonomics:

```
