Lines
100.00%
9 / 9
Methods
100.00%
3 / 3
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| label | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| help | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| icon | 100.00% | 7 / 7 | 100.00% | 1 / 1 | 7 | ||
| 11 | enum ProfilePart: string | |
| 12 | { | |
| 13 | /** Agent name, faction and level (from the latest stats). */ | |
| 14 | case AGENT = 'agent'; | |
| 15 | case AVATAR = 'avatar'; | |
| 16 | case LATEST_STATS = 'latest_stats'; | |
| 17 | case STATS_HISTORY = 'stats_history'; | |
| 18 | case CUSTOM_MEDALS = 'custom_medals'; | |
| 19 | /** The Bannergress counts and lists the app synced. */ | |
| 20 | case BANNERGRESS = 'bannergress'; | |
| 21 | ||
| 22 | /** A translation key (messages). */ | |
| 23 | public function label(): string | |
| 24 | { | |
| 25 | return 'profile_part.'.$this->value.'.label'; | |
| 26 | } | |
| 27 | ||
| 28 | /** A translation key (messages). */ | |
| 29 | public function help(): string | |
| 30 | { | |
| 31 | return 'profile_part.'.$this->value.'.help'; | |
| 32 | } | |
| 33 | ||
| 34 | /** The Bootstrap icon in the admins' list of users (the app uses the same). */ | |
| 35 | public function icon(): string | |
| 36 | { | |
| 37 | return match ($this) { | |
| 38 | self::AGENT => 'bi-person', | |
| 39 | self::AVATAR => 'bi-image', | |
| 40 | self::LATEST_STATS => 'bi-bar-chart', | |
| 41 | self::STATS_HISTORY => 'bi-clock-history', | |
| 42 | self::CUSTOM_MEDALS => 'bi-award', | |
| 43 | self::BANNERGRESS => 'bi-grid-3x3-gap', | |
| 44 | }; | |
| 45 | } | |
| 46 | } |