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

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

esky/enum
=========

PHP Enum implementation

1.1.1(11y ago)296.6k↓29.5%12MITPHPPHP &gt;=5.3.0

Since Nov 14Pushed 11y ago3 watchersCompare

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

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

PHP Enum implementation
=======================

[](#php-enum-implementation)

[![Build Status](https://camo.githubusercontent.com/0315b5e0bc1ff62a5801039af0952558f0df3bafb39f3cc7e6151eb174f569ed/68747470733a2f2f7472617669732d63692e6f72672f65736b79706c2f656e756d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/eskypl/enum)

\##Documentation

### construct

[](#construct)

```
$type = new Type(Type::BASIC);
$type = Type::createFromConstantName('BASIC');
$type = Type::BASIC();

new Type(5); // InvalidArgumentException
```

### instance methods

[](#instance-methods)

```
$type->getValue(); // 1
$type->getName(); // BASIC
$type->isEqual($type); // true
$type->isEqual(Type::Basic); // true
```

### static methods

[](#static-methods)

```
Type::getValues(); // [1, 2]
Type::getNames(); // [1 => 'BASIC', 2 => 'COMPLEX']
Type::getNames([2]); // [2 => 'COMPLEX']

Type::isValidValue(1); // true
Type::isValidValue(3); // false
```

### handle null value

[](#handle-null-value)

```
$nullType = new Type(null);

$nullType->getName(); // null
$nullType->getValue(); // null
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~91 days

Total

3

Last Release

4020d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c9fc3e462354dd3953d3e403cf91558d8f1651ddf06abf357a972ff3998dcbd?d=identicon)[tkolodziej](/maintainers/tkolodziej)

---

Top Contributors

[![tkolodziej-zz](https://avatars.githubusercontent.com/u/6974908?v=4)](https://github.com/tkolodziej-zz "tkolodziej-zz (6 commits)")[![diablonator](https://avatars.githubusercontent.com/u/122015010?v=4)](https://github.com/diablonator "diablonator (2 commits)")[![tomasz-kolodziej-esky](https://avatars.githubusercontent.com/u/137406885?v=4)](https://github.com/tomasz-kolodziej-esky "tomasz-kolodziej-esky (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[leafo/lessphp

lessphp is a compiler for LESS written in PHP.

2.2k8.2M141](/packages/leafo-lessphp)[realrashid/sweet-alert

Laravel Sweet Alert Is A Package For Laravel Provides An Easy Way To Display Alert Messages Using The SweetAlert2 Library.

1.2k2.9M21](/packages/realrashid-sweet-alert)[symfony/polyfill-php55

Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions

10731.7M9](/packages/symfony-polyfill-php55)[helmich/typo3-typoscript-lint

Static code analysis for the TypoScript configuration language.

902.9M241](/packages/helmich-typo3-typoscript-lint)[cyclonedx/cyclonedx-php-composer

Creates CycloneDX Software Bill-of-Materials (SBOM) from PHP Composer projects

821.6M17](/packages/cyclonedx-cyclonedx-php-composer)[kartik-v/yii2-widget-touchspin

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle touchspines (sub repo split from yii2-widgets)

184.1M6](/packages/kartik-v-yii2-widget-touchspin)

PHPackages © 2026

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