Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / metamta / constants / PhabricatorMailOutboundStatus.php
blob7d376a82d9bd43d37ef4447862e9b16cd93f63d6
1 <?php
3 final class PhabricatorMailOutboundStatus
4 extends Phobject {
6 const STATUS_QUEUE = 'queued';
7 const STATUS_SENT = 'sent';
8 const STATUS_FAIL = 'fail';
9 const STATUS_VOID = 'void';
12 public static function getStatusName($status_code) {
13 $names = array(
14 self::STATUS_QUEUE => pht('Queued'),
15 self::STATUS_FAIL => pht('Delivery Failed'),
16 self::STATUS_SENT => pht('Sent'),
17 self::STATUS_VOID => pht('Voided'),
19 $status_code = coalesce($status_code, '?');
20 return idx($names, $status_code, $status_code);
23 public static function getStatusIcon($status_code) {
24 $icons = array(
25 self::STATUS_QUEUE => 'fa-clock-o',
26 self::STATUS_FAIL => 'fa-warning',
27 self::STATUS_SENT => 'fa-envelope',
28 self::STATUS_VOID => 'fa-trash',
30 return idx($icons, $status_code, 'fa-question-circle');
33 public static function getStatusColor($status_code) {
34 $colors = array(
35 self::STATUS_QUEUE => 'blue',
36 self::STATUS_FAIL => 'red',
37 self::STATUS_SENT => 'green',
38 self::STATUS_VOID => 'black',
41 return idx($colors, $status_code, 'yellow');