final class MobytOptions implements MessageOptionsInterface
{ public const MESSAGE_TYPE_QUALITY_HIGH = 'N';
public const MESSAGE_TYPE_QUALITY_MEDIUM = 'L';
public const MESSAGE_TYPE_QUALITY_LOW = 'LL';
private array
$options;
public function __construct(array
$options =
[]) { if (isset($options['message_type'
])) { self::
validateMessageType($options['message_type'
]);
} $this->options =
$options;
} public static function fromNotification(Notification
$notification): self
{ $options =
new self();
match ($notification->
getImportance()) { Notification::IMPORTANCE_HIGH, Notification::IMPORTANCE_URGENT =>
$options->
messageType(self::MESSAGE_TYPE_QUALITY_HIGH
),
Notification::IMPORTANCE_MEDIUM =>
$options->
messageType(self::MESSAGE_TYPE_QUALITY_MEDIUM
),