Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
CollectivityTypeDictionary
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getTypes
100.00% covered (success)
100.00%
12 / 12
100.00% covered (success)
100.00%
1 / 1
1
 getTypesKeys
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
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\User\Dictionary;
25
26use App\Application\Dictionary\SimpleDictionary;
27
28class CollectivityTypeDictionary extends SimpleDictionary
29{
30    public const TYPE_COMMUNE              = 'commune';
31    public const TYPE_CCAS                 = 'ccas';
32    public const TYPE_EPCI                 = 'epci';
33    public const TYPE_CIAS                 = 'cias';
34    public const TYPE_SYNDICAT             = 'syndicat';
35    public const TYPE_SANITARY_INSTITUTION = 'sanitary_institution';
36    public const TYPE_MEDICAL_INSTITUTION  = 'medical_institution';
37    public const TYPE_ASSOCIATION          = 'association';
38    public const TYPE_ENTERPRISE           = 'enterprise';
39    public const TYPE_OTHER                = 'other';
40
41    public function __construct()
42    {
43        parent::__construct('user_collectivity_type', self::getTypes());
44    }
45
46    /**
47     * Get an array of Types.
48     *
49     * @return array
50     */
51    public static function getTypes()
52    {
53        return [
54            self::TYPE_COMMUNE              => 'Commune',
55            self::TYPE_CCAS                 => 'Centre Communal d’Action Sociale (CCAS)',
56            self::TYPE_EPCI                 => 'Établissement Public de Coopération Intercommunale (EPCI)',
57            self::TYPE_CIAS                 => 'Centre Intercommunal d’Action Sociale (CIAS)',
58            self::TYPE_SYNDICAT             => 'Syndicat',
59            self::TYPE_SANITARY_INSTITUTION => 'Établissement sanitaire',
60            self::TYPE_MEDICAL_INSTITUTION  => 'Établissement social ou médico-social',
61            self::TYPE_ASSOCIATION          => 'Association ou Groupement (GIP ou GIE)',
62            self::TYPE_ENTERPRISE           => 'Entreprise',
63            self::TYPE_OTHER                => 'Autre',
64        ];
65    }
66
67    /**
68     * Get keys of the Types array.
69     *
70     * @return array
71     */
72    public static function getTypesKeys()
73    {
74        return \array_keys(self::getTypes());
75    }
76}