Completed
Pull Request — master (#1537)
by José
29:27
created

GoogleMapsPlugin   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 55
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A get_name() 0 4 1
A create() 0 6 2
A install() 0 4 1
A uninstall() 0 4 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
/**
4
 * The google maps class allows to use
5
 * @author José Loguercio Silva <[email protected]>
6
 * @package chamilo.plugin.google_maps
7
 */
8
class GoogleMapsPlugin extends Plugin
9
{
10
    /**
11
     * Class constructor
12
     */
13
    protected function __construct()
14
    {
15
        $parameters = array(
16
            'enable_api' => 'boolean',
17
            'api_key' => 'text'
18
        );
19
20
        parent::__construct('1.0', 'José Loguercio Silva', $parameters);
21
    }
22
23
    /**
24
     * Get the plugin Name
25
     *
26
     * @return string
27
     */
28
    public function get_name()
29
    {
30
        return "google_maps";
31
    }
32
33
    /**
34
     * Instance the plugin
35
     * @staticvar null $result
36
     * @return GoogleMapsPlugin
37
     */
38
    static function create()
39
    {
40
        static $result = null;
41
42
        return $result ? $result : $result = new self();
43
    }
44
45
    /**
46
     * Install the plugin
47
     * @return void
48
     */
49
    public function install()
50
    {
51
        return true;
52
    }
53
54
    /**
55
     * Uninstall the plugin
56
     * @return void
57
     */
58
    public function uninstall()
59
    {
60
        return true;
61
    }
62
}
63