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. alexkratky/simple-enum

ActiveLibrary

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 1mo ago

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

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

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://www.gravatar.com/avatar/b26914cbd1aae790e4de261206944ef146af64f8f9fc8b4484c0697dfa333d05?d=identicon)[AlexKratky](/maintainers/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)
```

PHPackages © 2026

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