PHPackages                             alexkratky/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. alexkratky/simple-enum

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

alexkratky/simple-enum
======================

Simple PHP Enum library.

00PHP

Since Sep 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/AlexKratky/simple-enum)[ Packagist](https://packagist.org/packages/alexkratky/simple-enum)[ RSS](/packages/alexkratky-simple-enum/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

SimpleEnum
==========

[](#simpleenum)

Simple PHP Enum library.

### Installation

[](#installation)

`composer require alexkratky/simple-enum`

### Usage

[](#usage)

```
require 'vendor/autoload.php';

use AlexKratky\Enum\Enum;

class TestEnum extends Enum {
    public const CZ = 'Czech Republic';
    public const SK = 'Slovakia Republic';
}

$enum = new TestEnum('Czech Republic');

echo $enum->key() . ': ' . $enum->value() . "\n";

var_dump(TestEnum::toArray());

var_dump(TestEnum::toArrayWithKeys());
```

*See /examples/ for more examples*

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33813757?v=4)[Alex Krátký](/maintainers/AlexKratky)[@AlexKratky](https://github.com/AlexKratky)

---

Top Contributors

[![AlexKratky](https://avatars.githubusercontent.com/u/33813757?v=4)](https://github.com/AlexKratky "AlexKratky (1 commits)")

### Embed Badge

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

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

###  Alternatives

[marquine/php-etl

Extract, Transform and Load data using PHP.

182138.3k](/packages/marquine-php-etl)[assisted-mindfulness/naive-bayes

Naive Bayes classifier algorithm

45536.2k](/packages/assisted-mindfulness-naive-bayes)[bobey/geoip2-geolite2-composer

This tiny repository aims to provide an easy solution to require GeoIP2 / GeoLite2 databases inside your project using composer.

17896.8k1](/packages/bobey-geoip2-geolite2-composer)[sniccowp/php-scoper-wordpress-excludes

A list of all WordPress core classes, functions and constants. Meant to be used with the PHP-Scoper exclusion functionality.

16179.2k6](/packages/sniccowp-php-scoper-wordpress-excludes)[mage-os/mageos-async-events

An event-driven flexible async events module that allows you to process any event asynchronously.

3223.5k5](/packages/mage-os-mageos-async-events)[that0n3guy/transliteration

Transliteration provides one-way string transliteration (romanization) and cleans text by replacing unwanted characters.

12101.6k4](/packages/that0n3guy-transliteration)

PHPackages © 2026

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