Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
91.67% |
11 / 12 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
DocumentTypeDictionary | |
91.67% |
11 / 12 |
|
66.67% |
2 / 3 |
3.01 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTypes | |
100.00% |
10 / 10 |
|
100.00% |
1 / 1 |
1 | |||
getTypesKeys | |
0.00% |
0 / 1 |
|
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\Documentation\Dictionary; |
25 | |
26 | use App\Application\Dictionary\SimpleDictionary; |
27 | |
28 | class DocumentTypeDictionary extends SimpleDictionary |
29 | { |
30 | public const TYPE_AUDIO = 'Audio'; |
31 | public const TYPE_DOCX = 'Document'; |
32 | public const TYPE_EXCEL = 'Excel'; |
33 | public const TYPE_IMG = 'Image'; |
34 | public const TYPE_LINK = 'Lien'; |
35 | public const TYPE_PDF = 'PDF'; |
36 | public const TYPE_PPT = 'PowerPoint'; |
37 | public const TYPE_MP4 = 'Vidéo'; |
38 | |
39 | public function __construct() |
40 | { |
41 | parent::__construct('documentation_document_type', self::getTypes()); |
42 | } |
43 | |
44 | /** |
45 | * Get an array of Objects. |
46 | * |
47 | * @return array |
48 | */ |
49 | public static function getTypes() |
50 | { |
51 | return [ |
52 | self::TYPE_AUDIO => 'Audio', |
53 | self::TYPE_DOCX => 'Document', |
54 | self::TYPE_EXCEL => 'Excel', |
55 | self::TYPE_IMG => 'Image', |
56 | self::TYPE_LINK => 'Lien', |
57 | self::TYPE_PDF => 'PDF', |
58 | self::TYPE_PPT => 'PowerPoint', |
59 | self::TYPE_MP4 => 'Vidéo', |
60 | ]; |
61 | } |
62 | |
63 | /** |
64 | * Get keys of the Objects array. |
65 | * |
66 | * @return array |
67 | */ |
68 | public static function getTypesKeys() |
69 | { |
70 | return \array_keys(self::getTypes()); |
71 | } |
72 | } |