PHPackages                             ll-kuma-ll/php-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. ll-kuma-ll/php-enum

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

ll-kuma-ll/php-enum
===================

enumrated type class

v1.0.0(8y ago)025PHPPHP &gt;=7.0

Since Oct 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ll-kuma-ll/php-enum)[ Packagist](https://packagist.org/packages/ll-kuma-ll/php-enum)[ RSS](/packages/ll-kuma-ll-php-enum/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

php-enum
========

[](#php-enum)

列挙型をPHPで利用するためにクラスで実装。
毎度作成するのが面倒なので、composerライブラリとして読み込める様に作成。

Composer設定
----------

[](#composer設定)

```
php composer.phar require ll-kuma-ll/php-enum
```

定義サンプル
------

[](#定義サンプル)

```
namespace Foo;

use LLkumaLL\Enum\Enum;

class Sample extends Enum
{
    const ENUM = [
        'VALUE_1' => 'label 1',
        'VALUE_2' => 'label 2',
    ];
}
```

利用サンプル
------

[](#利用サンプル)

```
use LLkumaLL\Enum\Manager;
use Foo\Sample;

// 単独で使いたい場合
$enum = Sample::VALUE_1();
// 'label 1' が出力される
echo $enum->label();
// 'VALUE_1' が出力される
echo $enum->value();

// まとめて取り扱いたい場合
$manager = new Manager(Sample::class);

// ENUM定数配列の定義分全部をループ処理
foreach ($manager->createAll() as $const => $enum) {
    // '同じ'が出力される
    echo $const == $enum->value() ? '同じ' : '違う';
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Every ~0 days

Total

2

Last Release

3131d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/601dd975a5d8d5d83e331746ef8a6c654fb921b120d91769ee54d9bf62580a07?d=identicon)[ll-kuma-ll](/maintainers/ll-kuma-ll)

---

Top Contributors

[![ll-kuma-ll](https://avatars.githubusercontent.com/u/2649878?v=4)](https://github.com/ll-kuma-ll "ll-kuma-ll (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ll-kuma-ll-php-enum/health.svg)

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

###  Alternatives

[rashid2538/php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

71129.8k](/packages/rashid2538-php-htmldiff)[tchoulom/view-counter-bundle

The "View Counter" bundle

1731.3k](/packages/tchoulom-view-counter-bundle)[edofre/laravel-fullcalendar-scheduler

Laravel component for fullcalendar scheduler module

251.5k](/packages/edofre-laravel-fullcalendar-scheduler)

PHPackages © 2026

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