PHPackages                             leafs/shu - 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. leafs/shu

ActiveLibrary

leafs/shu
=========

State machine in a bottle

11PHP

Since Oct 13Pushed 2y agoCompare

[ Source](https://github.com/leafsphp/Shu)[ Packagist](https://packagist.org/packages/leafs/shu)[ RSS](/packages/leafs-shu/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

 [![](https://camo.githubusercontent.com/d98ee5e32c2ff016fdfdac6c42654a908f4cc34b229c7b00caacc5a717455ae8/68747470733a2f2f6c6561667068702e6465762f6c6f676f2d636972636c652e706e67)](https://camo.githubusercontent.com/d98ee5e32c2ff016fdfdac6c42654a908f4cc34b229c7b00caacc5a717455ae8/68747470733a2f2f6c6561667068702e6465762f6c6f676f2d636972636c652e706e67)

Shū
===

[](#shū)

 [![Latest Stable Version](https://camo.githubusercontent.com/954902e228c28c9e736c5e2ff91f043db222d1a22e219ddf30feba49fc06934f/68747470733a2f2f706f7365722e707567782e6f72672f6c656166732f7368752f762f737461626c65)](https://packagist.org/packages/leafs/shu) [![Total Downloads](https://camo.githubusercontent.com/6e8343859884b09fe4bc2eb25088c250cb72679b59ab5ad1333b4c48a378f02a/68747470733a2f2f706f7365722e707567782e6f72672f6c656166732f7368752f646f776e6c6f616473)](https://packagist.org/packages/leafs/shu) [![License](https://camo.githubusercontent.com/3dc9e40add4c1f2a93abb0de1be5cdf33464a1849174a0d375acea9c1801a068/68747470733a2f2f706f7365722e707567782e6f72672f6c656166732f7368752f6c6963656e7365)](https://packagist.org/packages/leafs/shu)

Shū is an event-driven state (aka state machine) library for PHP. It is designed to be lightweight, easy to use and easy to extend. Unlike other state libraries, Shū is not bound to any framework and can be used in any PHP project.

🗂 Basic Usage
-------------

[](#-basic-usage)

There are many ways to use Shū. The easiest way is to define your states and events in a state file and then load it into Shū.

```
