public function canJumpToState($state)
    {
        if ($state instanceof StateInterface) {
            $state = $state->getName();
        }

        // assert that the given state exists
        $this->getState($state);

        return in_array($this->currentState->getName(), $this->statePrecedence[$state], true);
    }
public function canJumpToState($state)
    {
        if ($state instanceof StateInterface) {
            $state = $state->getName();
        }

        // assert that the given state exists
        $this->getState($state);

        return in_array($this->currentState->getName(), $this->statePrecedence[$state], true);
    }
public function canJumpToState ( $ state ) { if ( $ state instanceof StateInterface ) { $ state = $ state -> getName ( ) ; } // assert that the given state exists $ this -> getState ( $ state ) ; return in_array ( $ this -> currentState -> getName ( ) , $ this -> statePrecedence [ $ state ] , true ) ; }
Tells if moving to the given state is allowed.

@param string|StateInterface $state

@return bool
Tells if moving to the given state is allowed .