ConfigTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 5
c 1
b 0
f 0
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setConfig() 0 5 1
A getConfig() 0 3 3
1
<?php namespace AgelxNash\Modx\Evo\Database\Traits;
2
3
trait ConfigTrait
4
{
5
    /**
6
     * @var array
7
     */
8
    protected $config = [];
9
10
    /**
11
     * {@inheritDoc}
12
     */
13 85
    public function getConfig($key = null)
14
    {
15 85
        return ($key === null ? $this->config : (isset($this->config[$key]) ? $this->config[$key] : null));
16
    }
17
18
    /**
19
     * {@inheritDoc}
20
     */
21 85
    public function setConfig($data)
22
    {
23 85
        $this->config = $data;
24
25 85
        return $this;
26
    }
27
}
28