PHPackages                             sammakescode/enums-extended - 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. sammakescode/enums-extended

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

sammakescode/enums-extended
===========================

Extended functionality for PHP's enums. Add labels, pick random, associative arrays and more.

v1.0.0(8mo ago)019MITPHPPHP &gt;=8.1

Since Sep 10Pushed 8mo agoCompare

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

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

Enums extended
==============

[](#enums-extended)

The [introduction of enums in PHP 8.1](https://www.php.net/manual/en/language.enumerations.basics.php) allowed developers to define a closed set of values for classes, configuration, etc. Very helpful!

This library attempts to build on that a little by adding functionality for common use cases.

Usage
-----

[](#usage)

### List

[](#list)

Here are a list of the current helpers.

NameDescriptionMethod usageDocsAsOptionsReturns an associative array of cases`SomeTrait::asOptions()`[Reference](./docs/AsOptions.md)GetValuesReturns an array of case values`SomeTrait::getValues()`[Reference](./docs/GetValues.md)LabelsAllow user-defined labels and descriptions`SomeTrait::SomeCase->label()` or `SomeTrait::SomeCase->describe()`[Reference](./docs/Labels.md)PickRandomReturns a randomly selected case from an enum`SomeTrait::pickRandom()`[Reference](./docs/PickRandom.md)Requirements
------------

[](#requirements)

- PHP &gt;= 8.1

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

[](#installation)

To install this library, simply require them using composer.

```
composer require sammakescode/enums-extended
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance60

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

250d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96775b72e83f533028dc82c8f24df717f837f8b3ba00b6f25e305179ef627c3b?d=identicon)[SamMakesCode](/maintainers/SamMakesCode)

---

Top Contributors

[![SamMakesCode](https://avatars.githubusercontent.com/u/10065536?v=4)](https://github.com/SamMakesCode "SamMakesCode (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sammakescode-enums-extended/health.svg)

```
[![Health](https://phpackages.com/badges/sammakescode-enums-extended/health.svg)](https://phpackages.com/packages/sammakescode-enums-extended)
```

PHPackages © 2026

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