I doubt that is there any state machine framework like https://github.com/pluginaweek/state_machine for PHP.
I've had to define many if-else logical clauses, and I would like something to help make it more fun by just defining:
- Condition required to transition
- State after transition
Then this can be reused to check if conditions match or not, for example
$customer->transition('platinum');
I expect this line of code to implicitly check if the customer can transition or not. Or explicitly check by:
$customer->canTransitTo('platinum');
Thanks in advance, noomz
I have used this one https://github.com/yohang/Finite which is quite powerfull, however the docs are not so detailed. If you are familliar with state machines then you shouldn't have any problem.