PHPackages                             evaisse/php-simple-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. evaisse/php-simple-enum

ActiveLibrary

evaisse/php-simple-enum
=======================

A very stupid, basic, enum control struct for php

v1.0.0(5y ago)04MITPHPPHP &gt;=5.6.0CI failing

Since May 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/evaisse/php-simple-enum)[ Packagist](https://packagist.org/packages/evaisse/php-simple-enum)[ RSS](/packages/evaisse-php-simple-enum/feed)WikiDiscussions master Synced 1w ago

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

php-simple-enum
===============

[](#php-simple-enum)

[![codecov](https://camo.githubusercontent.com/897bb24150572e5f0a02a030442c6c88fb30d18795c272844297c0da48fe66f6/68747470733a2f2f636f6465636f762e696f2f67682f657661697373652f7068702d73696d706c652d656e756d2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/evaisse/php-simple-enum)[![Build Status](https://camo.githubusercontent.com/d69996c0c194762146bf5fd3faca3188e6cc617158ad3276dd4f565190f4842d/68747470733a2f2f7472617669732d63692e6f72672f657661697373652f7068702d73696d706c652d656e756d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/evaisse/php-simple-enum)

A Simple ENUM utils, to ensure inputs are compliant with your some basic data structs.

```
composer require evaisse/php-simple-enum
```

Allow to fetch a static list of values from givens constants :

```
use evaisse\PhpSimpleEnum\PhpEnum;

$enumInt = new PhpEnum([
    'FOO' => 1,
    'BAR' => 2,
]);

$enum = PhpEnum::fromConstants('\Symfony\Component\HttpFoundation\Request::METHOD_*');

$enum->getAllowedValues();
/*
[
    'GET', 'POST', ...
]
 */

/*
 * Fetch enum name for a given value
 */
assert($enum->getKeyForValue(\Symfony\Component\HttpFoundation\Request::METHOD_GET) === 'METHOD_GET');

/*
 * test value
 */
$enum->isAllowed('GET'); // true

/*
 * fetch and assign, or throw invalid argument exception
 */
$param = $enum->validate($_GET['askedValue']);

/*
 * Fetch the whole dictonary
 */
$enum->getHash(); /*
   [
        'METHOD_GET' => 'GET',
        ...
    ]
*/
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

2182d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f8765f0d4bc19fa776ddc03f0eb9aad8c1f2ed72e3e0b9164ff3f496c6fb001?d=identicon)[evaisse](/maintainers/evaisse)

---

Top Contributors

[![evaisse](https://avatars.githubusercontent.com/u/28737?v=4)](https://github.com/evaisse "evaisse (21 commits)")

### Embed Badge

![Health badge](/badges/evaisse-php-simple-enum/health.svg)

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

###  Alternatives

[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

31252.7k5](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

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