title: PHP state machine framework
body: <p>I doubt that is there any state machine framework like <a href="https://github.com/pluginaweek/state_machine" rel="noreferrer">https://github.com/pluginaweek/state_machine</a> for PHP.</p>
  
  <p>I've had to define many if-else logical clauses, and I would like something to help make it more fun by just defining:</p>
  
  <ol>
  <li>Condition required to transition</li>
  <li>State after transition</li>
  </ol>
  
  <p>Then this can be reused to check if conditions match or not, for example</p>
  
  <pre><code>$customer-&gt;transition('platinum');
  </code></pre>
  
  <p>I expect this line of code to implicitly check if the customer can transition or not. Or explicitly check by:</p>
  
  <pre><code>$customer-&gt;canTransitTo('platinum');
  </code></pre>
  
  <p>Thanks in advance,
  noomz</p>