State Machine implementation in PHP with DSL