PHPackages                             sidfate/fsm - 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. sidfate/fsm

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

sidfate/fsm
===========

A simple finite state machine

1.0.0(8y ago)114MITPHPPHP &gt;=5.3.0

Since Jun 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Sidfate/fsm)[ Packagist](https://packagist.org/packages/sidfate/fsm)[ Docs](https://github.com/Sidfate/alpha)[ RSS](/packages/sidfate-fsm/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Fsm
===

[](#fsm)

A simple finite state machine

Install
=======

[](#install)

`composer require sidfate/fsm`

Usage
=====

[](#usage)

```
$fsm = new Fsm([
    'init'=> 'green',
    'events'=> [
        ['name'=> 'warn', 'from'=> 'green', 'to'=> 'yellow'],
        ['name'=> 'stop', 'from'=> 'yellow', 'to'=> 'red'],
        ['name'=> 'go', 'from'=> 'red', 'to'=> 'green'],
    ]
]);

$fsm->onWarn(function () {
   echo 'I am warn';
});

echo $fsm->now();	// green
$fsm->warn();		// I am warn
echo $fsm->now();	// yellow

```

Document
========

[](#document)

[Click me](https://github.com/Sidfate/fsm/wiki)

License
=======

[](#license)

MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

3244d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a19d3f2ae1831bbd38c40c6cfecc7d4237cf00fee2852c2181c2c995923b1b6?d=identicon)[Sidfate](/maintainers/Sidfate)

---

Top Contributors

[![Sidfate](https://avatars.githubusercontent.com/u/10110451?v=4)](https://github.com/Sidfate "Sidfate (16 commits)")

---

Tags

fsmfsm

### Embed Badge

![Health badge](/badges/sidfate-fsm/health.svg)

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

###  Alternatives

[eftec/statemachineone

A state Machine library for business processes

1144.0k](/packages/eftec-statemachineone)[pwm/s-flow

A lightweight library for defining state machines

742.5k](/packages/pwm-s-flow)[shrink0r/workflux

Finite state machine for php.

375.6k1](/packages/shrink0r-workflux)[thetwelvelabs/techne

Finite State Machine implementation

412.4k](/packages/thetwelvelabs-techne)[ericlagarda/nova-text-card

A custom card for Laravel Nova to show Text in cards with some good options

20388.6k2](/packages/ericlagarda-nova-text-card)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

188.5k](/packages/tarfin-labs-event-machine)

PHPackages © 2026

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