mduk/PHPFiniteStateMachine
There was a particularly nasty model in a supremely untested codebase I worked on once. It was basically a FSM, but a nightmare to work with. This is an idea I had for trying to bring some order to it in a non-destructive manner. Never got to put it into practice. :(