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

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

k1low/stateful-enum
===================

Simple stateful enum plugin for CakePHP 3

v0.1.0(10y ago)12.6k2MITPHPPHP &gt;=5.4.16

Since Apr 6Pushed 10y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Simple stateful enum plugin for CakePHP 3 [![Build Status](https://camo.githubusercontent.com/058768c65635683b7df61569ee77c12f500ac06e4163965e55b1b892ad462a77/68747470733a2f2f7472617669732d63692e6f72672f6b314c6f572f737461746566756c2d656e756d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/k1LoW/stateful-enum)
==================================================================================================================================================================================================================================================================================================================================

[](#simple-stateful-enum-plugin-for-cakephp-3-)

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require k1low/stateful-enum

```

Usage
-----

[](#usage)

```
class BugsTable extends Table
{
    const STATUS_UNASSIGNED = 'unassigned';
    const STATUS_ASSIGNED = 'assigned';
    const STATUS_RESOLVED = 'resolved';
    const STATUS_CLOSED = 'closed';

    public $transitions = [
        'status' => [
            'assign' => [
                'from' => self::STATUS_UNASSIGNED,
                'to' => self::STATUS_ASSIGNED
            ],
            'resolve' => [
                [self::STATUS_ASSIGNED, self::STATUS_UNASSIGNED], // from
                self::STATUS_RESOLVED // to
            ],
            'close' => [
                [self::STATUS_ASSIGNED, self::STATUS_UNASSIGNED, self::STATUS_RESOLVED],
                self::STATUS_CLOSED
            ],
        ]
    ];

    public function initialize(array $config)
    {
        $this->primaryKey('id');
        $this->addBehavior('StatefulEnum.StatefulEnum');
    }
}
```

So, This plugin set build state rules automatically.

References
----------

[](#references)

This plugin is inspired by [https://github.com/amatsuda/stateful\_enum](https://github.com/amatsuda/stateful_enum)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3691d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e122a99dc7f41f91d17a191048ef65529fde0b76ebdecc66bea529363b65429b?d=identicon)[k1LoW](/maintainers/k1LoW)

---

Top Contributors

[![k1LoW](https://avatars.githubusercontent.com/u/57114?v=4)](https://github.com/k1LoW "k1LoW (7 commits)")

---

Tags

enumcakephpstate

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[markstory/asset_compress

An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.

3761.0M11](/packages/markstory-asset-compress)[cakedc/enum

Enumeration list Plugin for CakePHP 5

30222.5k2](/packages/cakedc-enum)[dereuromark/cakephp-shim

A CakePHP plugin to shim applications between major framework versions.

401.0M11](/packages/dereuromark-cakephp-shim)[cakedc/tiny-mce

TinyMCE Plugin for CakePHP

10790.2k](/packages/cakedc-tiny-mce)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)

PHPackages © 2026

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