Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
27.27% |
6 / 22 |
|
33.33% |
2 / 6 |
CRAP | |
0.00% |
0 / 1 |
MesurementPriorityDictionary | |
27.27% |
6 / 22 |
|
33.33% |
2 / 6 |
19.85 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPriorities | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
getPrioritiesKeys | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getWeightPriorities | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
getPrioritiesColors | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
getPrioritiesNameWithoutNumber | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | /** |
4 | * This file is part of the MADIS - RGPD Management application. |
5 | * |
6 | * @copyright Copyright (c) 2018-2019 Soluris - Solutions Numériques Territoriales Innovantes |
7 | * |
8 | * This program is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU Affero General Public License as published by |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU Affero General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU Affero General Public License |
19 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
20 | */ |
21 | |
22 | declare(strict_types=1); |
23 | |
24 | namespace App\Domain\Registry\Dictionary; |
25 | |
26 | use App\Application\Dictionary\SimpleDictionary; |
27 | |
28 | class MesurementPriorityDictionary extends SimpleDictionary |
29 | { |
30 | public const PRIORITY_LOW = 'low'; |
31 | public const PRIORITY_NORMAL = 'normal'; |
32 | public const PRIORITY_HIGH = 'high'; |
33 | |
34 | public function __construct() |
35 | { |
36 | parent::__construct('registry_mesurement_priority', self::getPriorities()); |
37 | } |
38 | |
39 | /** |
40 | * @return array |
41 | */ |
42 | public static function getPriorities() |
43 | { |
44 | return [ |
45 | self::PRIORITY_LOW => '1 - Basse', |
46 | self::PRIORITY_NORMAL => '2 - Normale', |
47 | self::PRIORITY_HIGH => '3 - Haute', |
48 | ]; |
49 | } |
50 | |
51 | /** |
52 | * @return array |
53 | */ |
54 | public static function getPrioritiesKeys() |
55 | { |
56 | return \array_keys(self::getPriorities()); |
57 | } |
58 | |
59 | /** |
60 | * @return array |
61 | */ |
62 | public static function getWeightPriorities() |
63 | { |
64 | return [ |
65 | self::PRIORITY_LOW => 1, |
66 | self::PRIORITY_NORMAL => 2, |
67 | self::PRIORITY_HIGH => 3, |
68 | ]; |
69 | } |
70 | |
71 | /** |
72 | * @return array |
73 | */ |
74 | public static function getPrioritiesColors() |
75 | { |
76 | return [ |
77 | self::PRIORITY_LOW => 'F2D600', |
78 | self::PRIORITY_NORMAL => 'FF9F1A', |
79 | self::PRIORITY_HIGH => 'EB5A46', |
80 | ]; |
81 | } |
82 | |
83 | /** |
84 | * @return array |
85 | */ |
86 | public static function getPrioritiesNameWithoutNumber() |
87 | { |
88 | return [ |
89 | self::PRIORITY_LOW => 'Basse', |
90 | self::PRIORITY_NORMAL => 'Normale', |
91 | self::PRIORITY_HIGH => 'Haute', |
92 | ]; |
93 | } |
94 | } |