Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
92.86% covered (success)
92.86%
13 / 14
66.67% covered (warning)
66.67%
2 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
NotificationModuleDictionary
92.86% covered (success)
92.86%
13 / 14
66.67% covered (warning)
66.67%
2 / 3
3.00
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getModules
100.00% covered (success)
100.00%
12 / 12
100.00% covered (success)
100.00%
1 / 1
1
 getModulesKeys
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
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
22declare(strict_types=1);
23
24namespace App\Domain\Notification\Dictionary;
25
26use App\Application\Dictionary\SimpleDictionary;
27use App\Domain\AIPD\Model\AnalyseImpact;
28use App\Domain\Documentation\Model\Document;
29use App\Domain\Maturity\Model\Maturity;
30use App\Domain\Notification\Model\Notification;
31use App\Domain\Registry\Model\ConformiteOrganisation\Conformite;
32use App\Domain\Registry\Model\ConformiteTraitement\ConformiteTraitement;
33use App\Domain\Registry\Model\Contractor;
34use App\Domain\Registry\Model\Mesurement;
35use App\Domain\Registry\Model\Proof;
36use App\Domain\Registry\Model\Request;
37use App\Domain\Registry\Model\Treatment;
38use App\Domain\Registry\Model\Violation;
39use App\Domain\User\Model\User;
40
41class NotificationModuleDictionary extends SimpleDictionary
42{
43    public const ACTION_PLAN = 'action_plan';
44
45    public function __construct()
46    {
47        parent::__construct('notificationModule', self::getModules());
48    }
49
50    /**
51     * Get an array of Roles.
52     *
53     * @return array
54     */
55    public static function getModules()
56    {
57        return [
58            Notification::MODULES[Treatment::class]  => 'Traitements',
59            Notification::MODULES[Contractor::class] => 'Sous-traitants',
60            Notification::MODULES[Request::class]    => 'Demandes',
61            Notification::MODULES[Violation::class]  => 'Violations',
62            Notification::MODULES[Proof::class]      => 'Preuves',
63            Notification::MODULES[Mesurement::class] => 'Actions de protection',
64            self::ACTION_PLAN                        => 'Plan d\'actions',
65            // Notification::MODULES[ConformiteTraitement::class] => 'Conformité du traitement',
66            // Notification::MODULES[Conformite::class]           => 'Conformité de la structure',
67            Notification::MODULES[AnalyseImpact::class] => 'AIPD',
68            // Notification::MODULES[Document::class]             => 'Espace Documentaire',
69            Notification::MODULES[Maturity::class] => 'Indice de maturité',
70            Notification::MODULES[User::class]     => 'Utilisateurs',
71        ];
72    }
73
74    /**
75     * Get keys of the Roles array.
76     *
77     * @return array
78     */
79    public static function getModulesKeys()
80    {
81        return \array_keys(self::getModules());
82    }
83}