SupportedTypes::getActions()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 2
eloc 2
nc 2
nop 1
1
<?php namespace Comodojo\Installer\Registry;
2
3
/**
4
 *
5
 *
6
 * @package     Comodojo Framework
7
 * @author      Marco Giovinazzi <[email protected]>
8
 * @author      Marco Castiello <[email protected]>
9
 * @license     GPL-3.0+
10
 *
11
 * LICENSE:
12
 *
13
 * This program is free software: you can redistribute it and/or modify
14
 * it under the terms of the GNU Affero General Public License as
15
 * published by the Free Software Foundation, either version 3 of the
16
 * License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU Affero General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU Affero General Public License
24
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
 */
26
27
class SupportedTypes {
28
29
    private static $supported_actions_by_type = array(
30
31
        'extender-plugins-bundle' => array(
32
            "comodojo-plugins-load" => "ExtenderPlugin",
33
            "extender-plugin-load" => "ExtenderPlugin"
34
        ),
35
36
	    'extender-tasks-bundle' => array(
37
            "comodojo-tasks-register" => "ExtenderTask",
38
            "extender-task-register" => "ExtenderTask"
39
        ),
40
41
	    'extender-commands-bundle' => array(
42
            "comodojo-commands-register" => "Command",
43
            "extender-command-register" => "Command"
44
        ),
45
46
	    'dispatcher-plugin' => array(
47
            "comodojo-plugin-load" => "DispatcherPlugin",
48
            "dispatcher-plugin-load" => "DispatcherPlugin"
49
        ),
50
51
	    'dispatcher-service-bundle' => array(
52
            "comodojo-service-route" => "Service",
53
            "dispatcher-service-route" => "Service"
54
        ),
55
56
        'comodojo-app' => array(
57
            "comodojo-app-register" => "App",
58
            "comodojo-configuration-register" => "Setting",
59
            "comodojo-rpc-register" => "Rpc",
60
            "comodojo-service-route" => "Service",
61
            "comodojo-task-register" => "Task",
62
            "comodojo-command-register" => "Command"
63
        ),
64
65
        'comodojo-components' => array(
66
            "comodojo-theme-register" => "Theme",
67
            "comodojo-authentication-register" => "Authentication"
68
        ),
69
70
	    'comodojo-bundle' => array(
71
            "dispatcher-plugin-load" => "DispatcherPlugin",
72
            "dispatcher-service-route" => "Service",
73
            "extender-plugin-load" => "ExtenderPlugin",
74
            "extender-command-register" => "Command",
75
            "extender-task-register" => "ExtenderTask",
76
            "comodojo-app-register" => "App",
77
            "comodojo-configuration-register" => "Setting",
78
            "comodojo-rpc-register" => "Rpc",
79
            "comodojo-service-route" => "Service",
80
            "comodojo-task-register" => "Task",
81
            "comodojo-command-register" => "Command",
82
            "comodojo-theme-register" => "Theme",
83
            "comodojo-authentication-register" => "Authentication"
84
        )
85
86
    );
87
88
    public static function getTypes() {
89
90
        return array_keys(self::$supported_actions_by_type);
91
92
    }
93
94
    public static function getActions($type) {
95
96
        return isset(self::$supported_actions_by_type[$type]) ? self::$supported_actions_by_type[$type] : array();
97
98
    }
99
100
}
101