Completed
Pull Request — master (#6)
by De Cramer
11:31
created

PluginDescription   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 98
rs 10
c 1
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPluginId() 0 4 1
A getDataProviders() 0 4 1
A getParents() 0 4 1
A setParents() 0 4 1
A setDataProviders() 0 4 1
A getChildrens() 0 4 1
A addChildren() 0 4 1
A isIsEnabled() 0 4 1
A setIsEnabled() 0 4 1
1
<?php
2
3
namespace eXpansion\Core\Model\Plugin;
4
5
/**
6
 * Store all the metadata for a certain plugin.
7
 *
8
 * @package eXpansion\Core\Model\Plugin
9
 * @author Oliver de Cramer
10
 */
11
class PluginDescription
12
{
13
    /** @var string */
14
    protected $pluginId;
15
16
    /** @var string[] */
17
    protected $dataProviders = [];
18
19
    /** @var string[] */
20
    protected $parents = [];
21
22
    /** @var PluginDescription[] */
23
    protected $childrens = [];
24
25
    /** @var bool  */
26
    protected $isEnabled = false;
27
28
    /**
29
     * PluginDescription constructor.
30
     * @param string $pluginId
31
     */
32
    public function __construct($pluginId)
33
    {
34
        $this->pluginId = $pluginId;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getPluginId()
41
    {
42
        return $this->pluginId;
43
    }
44
45
    /**
46
     * @return string[]
47
     */
48
    public function getDataProviders()
49
    {
50
        return $this->dataProviders;
51
    }
52
53
    /**
54
     * @return string[]
55
     */
56
    public function getParents()
57
    {
58
        return $this->parents;
59
    }
60
61
    /**
62
     * @param string[] $parents
63
     */
64
    public function setParents($parents)
65
    {
66
        $this->parents = $parents;
67
    }
68
69
    /**
70
     * @param string[] $dataProviders
71
     */
72
    public function setDataProviders($dataProviders)
73
    {
74
        $this->dataProviders = $dataProviders;
75
    }
76
77
    /**
78
     * @return PluginDescription[]
79
     */
80
    public function getChildrens()
81
    {
82
        return $this->childrens;
83
    }
84
85
    /**
86
     * @param PluginDescription $parent
87
     */
88
    public function addChildren(PluginDescription $parent)
89
    {
90
        $this->childrens[] = $parent;
91
    }
92
93
    /**
94
     * @return boolean
95
     */
96
    public function isIsEnabled()
97
    {
98
        return $this->isEnabled;
99
    }
100
101
    /**
102
     * @param boolean $isEnabled
103
     */
104
    public function setIsEnabled($isEnabled)
105
    {
106
        $this->isEnabled = $isEnabled;
107
    }
108
}
109