Last active
November 11, 2016 15:22
-
-
Save victorjonsson/c9a89574d0d6bcad1ea5d1b093d16d4b to your computer and use it in GitHub Desktop.
fsm.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class StateAbstract { | |
| protected function isInState($state) { | |
| } | |
| protected function transitionToState($newState) { | |
| } | |
| abstract function declareStates(); | |
| private function getStateTransitions() | |
| { | |
| if ($this->stateTransitions === null) { | |
| $this->stateTransitions = $this->declareStates(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment