3 final class PhabricatorBadgesQuality
14 const DEFAULT_QUALITY
= 140;
16 public static function getQualityName($quality) {
17 $map = self
::getQualityDictionary($quality);
18 $default = pht('Unknown Quality ("%s")', $quality);
19 return idx($map, 'name', $default);
22 public static function getQualityColor($quality) {
23 $map = self
::getQualityDictionary($quality);
25 return idx($map, 'color', $default);
28 private static function getQualityDictionary($quality) {
29 $map = self
::getQualityMap();
31 return idx($map, $quality, $default);
34 public static function getQualityMap() {
38 'name' => pht('Poor'),
41 self
::COMMON
=> array(
43 'name' => pht('Common'),
46 self
::UNCOMMON
=> array(
48 'name' => pht('Uncommon'),
53 'name' => pht('Rare'),
58 'name' => pht('Epic'),
61 self
::LEGENDARY
=> array(
63 'name' => pht('Legendary'),
66 self
::HEIRLOOM
=> array(
68 'name' => pht('Heirloom'),
74 public static function getDropdownQualityMap() {
75 $map = self
::getQualityMap();
76 return ipull($map, 'name');