public static function finalState(string $state) : InvalidTransitionException { return new static(sprintf('Can not transit from final state "%s"', $state)); }
/** * @throws InvalidTransitionException */ public function send() : OrderState { throw InvalidTransitionException::finalState('rejected'); }