Finite\StateMachine\StateMachine::findInitialState PHP Method

findInitialState() protected method

Find and return the Initial state if exists.
protected findInitialState ( ) : string
return string
    protected function findInitialState()
    {
        foreach ($this->states as $state) {
            if (State::TYPE_INITIAL === $state->getType()) {
                return $state->getName();
            }
        }
        throw new Exception\StateException(sprintf('No initial state found on object "%s" with graph "%s".', get_class($this->getObject()), $this->getGraph()));
    }