3 final class PhabricatorMailRoutingRule
extends Phobject
{
5 const ROUTE_AS_NOTIFICATION
= 'route.notification';
6 const ROUTE_AS_MAIL
= 'route.mail';
8 public static function isStrongerThan($rule_u, $rule_v) {
9 $strength_u = self
::getRuleStrength($rule_u);
10 $strength_v = self
::getRuleStrength($rule_v);
12 return ($strength_u > $strength_v);
15 public static function getRuleStrength($const) {
17 self
::ROUTE_AS_NOTIFICATION
=> 1,
18 self
::ROUTE_AS_MAIL
=> 2,
21 return idx($strength, $const, 0);
24 public static function getRuleName($const) {
26 self
::ROUTE_AS_NOTIFICATION
=> pht('Route as Notification'),
27 self
::ROUTE_AS_MAIL
=> pht('Route as Mail'),
30 return idx($names, $const, $const);
33 public static function getRuleIcon($const) {
35 self
::ROUTE_AS_NOTIFICATION
=> 'fa-bell',
36 self
::ROUTE_AS_MAIL
=> 'fa-envelope',
39 return idx($icons, $const, 'fa-question-circle');
42 public static function getRuleColor($const) {
44 self
::ROUTE_AS_NOTIFICATION
=> 'grey',
45 self
::ROUTE_AS_MAIL
=> 'grey',
48 return idx($colors, $const, 'yellow');