Download the PHP package zinovyev/php-fsm without Composer
On this page you can find all versions of the php package zinovyev/php-fsm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download zinovyev/php-fsm
More information about zinovyev/php-fsm
Files in zinovyev/php-fsm
Download zinovyev/php-fsm
More information about zinovyev/php-fsm
Files in zinovyev/php-fsm
Please rate this library. Is it a good library?
Informations about the package php-fsm
PHP Finite-state Machine
Finite-state machine allows you to create an object, containing different states and transitions between them, that can change its behaivour according to the current state.
Install:
For installing the FSM machine use Composer. Simply add following to your composer.json file:
Creating a State machine steps:
-
Create State classes and define states:
- Create a new FSM\Client instance (StateMachine).
- Bind your States to the Client instance, apply transactions and set initial state:
or
- Use Memento if you want do store current State and parameters and restore them later:
and restore:
- That's all =) Your simple State machine is now configured and ready for use!
Example code:
Example code execution result:
If you run the code in your console, you'll see the following output:
All versions of php-fsm with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4
The package zinovyev/php-fsm contains the following files
Loading the files please wait ....