PHPackages                             xudid/statemachine - 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. xudid/statemachine

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

xudid/statemachine
==================

A state machine library

0.0.1(3y ago)00MITPHPCI passing

Since May 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/xudid/statemachine)[ Packagist](https://packagist.org/packages/xudid/statemachine)[ RSS](/packages/xudid-statemachine/feed)WikiDiscussions main Synced today

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

Statemachine
============

[](#statemachine)

A base state machine library

***Create and initialize states***

```
$stateMachine = new StateMachine();

$stateMachine->addState('initial');

$stateMachine->addState('final');

```

***Add a transition***

```
$stateMachine->transition('initial', 'final');

```

***Guard a transition with logic***

```
$stateMachine->transition('initial', 'final')
    ->guard(function(){
        return ....;
    });

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f769aa36c5d6873e61ffe6edd7653d4a1e0b925d6dc1ed584941da271d7c563?d=identicon)[xudid](/maintainers/xudid)

---

Top Contributors

[![xudid](https://avatars.githubusercontent.com/u/5628783?v=4)](https://github.com/xudid "xudid (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xudid-statemachine/health.svg)

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

###  Alternatives

[lloricode/laravel-html-table

Html table generator for laravel

1667.4k1](/packages/lloricode-laravel-html-table)[dzentota/chrome-dev-tools

This is a PHP lib that allows one to interact with Google Chrome using Chrome DevTools Protocol within a PHP script. Highly inspired by marty90/PyChromeDevTools

126.6k](/packages/dzentota-chrome-dev-tools)

PHPackages © 2026

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