Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / metamta / constants / PhabricatorMailRoutingRule.php
blob1e0e1b9e26bc32a24255e70ccdf75e40b30ae092
1 <?php
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) {
16 $strength = array(
17 self::ROUTE_AS_NOTIFICATION => 1,
18 self::ROUTE_AS_MAIL => 2,
21 return idx($strength, $const, 0);
24 public static function getRuleName($const) {
25 $names = array(
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) {
34 $icons = array(
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) {
43 $colors = array(
44 self::ROUTE_AS_NOTIFICATION => 'grey',
45 self::ROUTE_AS_MAIL => 'grey',
48 return idx($colors, $const, 'yellow');