Skip to content

Repository files navigation

Phwoolcon Finite State Machine

Build StatusCode CoverageLicense

See the definition of Finite-state machine on Wikipedia

Installation

Add this library to your project by composer:

composer require "phwoolcon/fsm"

Usage

<?phpusePhwoolcon\Fsm\StateMachine;
$fsm = StateMachine::create([
'foo' => [
'process' => 'bar',
],
'bar' => [
'process2' => 'hello',
'process3' => 'world',
],
]);
echo$fsm->getCurrentState(); // prints fooecho$fsm->next(); // prints barecho$fsm->do('process2'); // prints hello

About

Phwoolcon state machine

Topics

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages