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(2y ago)00MITPHPCI passing

Since May 26Pushed 12mo ago1 watchersCompare

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

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

21

—

LowBetter than 18% of packages

Maintenance37

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

1088d 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

[hybridlogic/phantomjs

A PHP library to execute PhantomJS scripts and return their results.

57158.3k](/packages/hybridlogic-phantomjs)[syntaxlexx/chatmessenger

Simple one-to-one/group chat messaging tool for Laravel 5, 6, 7, 8, 9 &amp; 10 with Pusher Integration

10510.2k](/packages/syntaxlexx-chatmessenger)

PHPackages © 2026

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