original_string: public function jumpToState($state)
      {
          if (!$state instanceof StateInterface) {
              $state = $this->getState($state);
          }
  
          if (!$this->canJumpToState($state)) {
              throw new StateException(sprintf('Can not jump from state "%s" to "%s".',$this->currentState->getName(), $state->getName()));
          }
  
          $this->object->setFiniteState($state->getName());
          $this->currentState = $state;
      }
code: public function jumpToState($state)
      {
          if (!$state instanceof StateInterface) {
              $state = $this->getState($state);
          }
  
          if (!$this->canJumpToState($state)) {
              throw new StateException(sprintf('Can not jump from state "%s" to "%s".',$this->currentState->getName(), $state->getName()));
          }
  
          $this->object->setFiniteState($state->getName());
          $this->currentState = $state;
      }
code_tokens: public function jumpToState ( $ state ) { if ( ! $ state instanceof StateInterface ) { $ state = $ this -> getState ( $ state ) ; } if ( ! $ this -> canJumpToState ( $ state ) ) { throw new StateException ( sprintf ( 'Can not jump from state "%s" to "%s".' , $ this -> currentState -> getName ( ) , $ state -> getName ( ) ) ) ; } $ this -> object -> setFiniteState ( $ state -> getName ( ) ) ; $ this -> currentState = $ state ; }
docstring: Moves to the given state if allowed.
  
  @param string|StateInterface $state
  
  @return bool
docstring_tokens: Moves to the given state if allowed .