XState - A State Machine for PHP
State machine library to play with any complex behavior of your PHP objects
Installation
You can install the package via composer:
composer require mouadziani/xstate
WIP - Usage
$video = StateMachine::make()
->defaultState('stopped')
->states(['playing', 'stopped', 'paused'])
->transitions([
new Transition('PLAY', 'stopped', 'playing'),
new Transition('STOP', 'playing', 'stopped'),
new Transition('PAUSE', 'playing', 'paused'),
new Transition('RESUME', 'paused', 'playing'),
]);
Testing
composer test
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.