src/Finite/StateMachine/StateMachine.php
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()
        ));
    }
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()
        ));
    }
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 ( ) ) ) ; }
Find and return the Initial state if exists.

@return string

@throws Exception\StateException
Find and return the Initial state if exists .