protected function _transition($transition)
    {
        if (!$this->_canTransition($transition)) {
            throw $this->_createCouldNotTransitionException(
                $this->__('Cannot apply transition "%s"', $transition),
                null,
                null,
                $transition
            );
        }

        return $this->_applyTransition($transition);
    }
protected function _transition($transition)
    {
        if (!$this->_canTransition($transition)) {
            throw $this->_createCouldNotTransitionException(
                $this->__('Cannot apply transition "%s"', $transition),
                null,
                null,
                $transition
            );
        }

        return $this->_applyTransition($transition);
    }
protected function _transition ( $ transition ) { if ( ! $ this -> _canTransition ( $ transition ) ) { throw $ this -> _createCouldNotTransitionException ( $ this -> __ ( 'Cannot apply transition "%s"' , $ transition ) , null , null , $ transition ) ; } return $ this -> _applyTransition ( $ transition ) ; }
Applies a transition.

@since [*next-version*]

@param string|Stringable $transition The transition code.

@throws CouldNotTransitionExceptionInterface If the transition failed or was aborted.
@throws StateMachineExceptionInterface       If an error was encountered during transition.

@return StateMachineInterface The state machine with the new state.
Applies a transition .