public static function unexpectedTransition($fromState, $toState) : InvalidTransitionException { return new static(sprintf('Can not transit from "%s" to "%s"', $fromState, $toState)); }
/** * @throws InvalidTransitionException */ public function reject() : PaymentState { throw InvalidTransitionException::unexpectedTransition('paid', 'rejected'); }