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

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

fixmind/enum
============

Class organizes collections of constants. Gives the ability to keep code clear, transparent and strict.

1.0.2(6y ago)0492MITPHP

Since Jul 15Pushed 6y agoCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (2)

Enum - missing type in PHP
==========================

[](#enum---missing-type-in-php)

Class organizes collections of constants. Gives the ability to keep code clear, transparent and strict. Like the SplEnum class, but much better.

USAGE - two ways to define a collection
=======================================

[](#usage---two-ways-to-define-a-collection)

```
class Vertical extends Enum
{
	const TOP = 'TOP';
	const MIDDLE = 'MIDDLE';
	const BOTTOM = 'BOTTOM';
}

// OR

class Horizontal extends Enum
{
	const VALUE = ['LEFT', 'CENTER', 'RIGHT'];
}
```

4 REASONS TO USE
================

[](#4-reasons-to-use)

### 1 REASON - use ENUM to extortion type of param method

[](#1-reason---use-enum-to-extortion-type-of-param-method)

```
class MyClass
{
	public function __construct(Vertical $vertical)
	{
	}
}

new MyClass(Vertical::TOP());
```

### 2 USAGE - easy value compare

[](#2-usage---easy-value-compare)

```
if (Vertical::TOP() == 'TOP')
{
	if (Vertical::TOP()->is(Vertical::TOP))
	{
	}
}
```

### 3 USAGE - list of posibilitis

[](#3-usage---list-of-posibilitis)

```
foreach(Vertical::getOptionList() as $option)
{
	echo $option;
}
```

### 4 USAGE - check if option exists

[](#4-usage---check-if-option-exists)

```
if (Vertical::isValid('TOP'))
{
	echo 'TOP is a valid value of Vertical Enum';
}
if (Vertical::isValid('LEFT') == false)
{
	echo 'LEFT is not a valid value of Vertical Enum';
}
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

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

Total

2

Last Release

2492d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22333085?v=4)[Michał Barcikowski](/maintainers/fixmind)[@fixmind](https://github.com/fixmind)

---

Top Contributors

[![fixmind](https://avatars.githubusercontent.com/u/22333085?v=4)](https://github.com/fixmind "fixmind (9 commits)")

---

Tags

typeenumenumerablestrictvariabletransparentclearconstant

### Embed Badge

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

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

###  Alternatives

[spatie/enum

PHP Enums

84931.4M74](/packages/spatie-enum)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49753.5M104](/packages/marc-mabe-php-enum)[consistence/consistence

Consistence - consistent approach and additions to PHP's functionality

1821.1M18](/packages/consistence-consistence)[happy-types/enumerable-type

Strongly typed implementation of enumerable type in PHP which helps us to write a safer more readable code.

4542.9k](/packages/happy-types-enumerable-type)[garoevans/php-enum

Convenient way to always have an Enum object available and utilise Spl Types if available.

19163.2k5](/packages/garoevans-php-enum)

PHPackages © 2026

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