Plugin   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 2
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A registerStyle() 0 3 1
A registerScript() 0 3 1
A getStyles() 0 3 1
A getScripts() 0 3 1
1
<?php
2
/**
3
 * ownCloud - News
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Alessandro Cosentino <[email protected]>
9
 * @author Bernhard Posselt <[email protected]>
10
 * @copyright Alessandro Cosentino 2012
11
 * @copyright Bernhard Posselt 2012, 2014
12
 */
13
14
namespace OCA\News\Plugin\Client;
15
16
/**
17
 * We actually really want to avoid this global list of plugins. A way would be
18
 * for News plugin apps to register themselves in a special database table
19
 * and the News app would just pull out the scripts that should be attached
20
 * but atm there is no really good way since there is no uninstall hook which
21
 * would remove the plugin from the apps so fk it :)
22
 */
23
class Plugin {
24
25
    private static $scripts = [];
26
    private static $styles = [];
27
28
    public static function registerStyle($appName, $styleName) {
29
        self::$styles[$appName] = $styleName;
30
    }
31
32
    public static function registerScript($appName, $scriptName) {
33
        self::$scripts[$appName] = $scriptName;
34
    }
35
36
    public static function getStyles() {
37
        return self::$styles;
38
    }
39
40
    public static function getScripts() {
41
        return self::$scripts;
42
    }
43
44
}