Completed
Push — master ( a45e07...0294bf )
by Agel_Nash
02:52
created

ConfigTrait::getConfig()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 3
eloc 1
nc 4
nop 1
crap 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
     * @param null|string $key
12
     * @return mixed
13
     */
14 68
    public function getConfig($key = null)
15
    {
16 68
        return ($key === null ? $this->config : (isset($this->config[$key]) ? $this->config[$key] : null));
17
    }
18
19
    /**
20
     * @param $data
21
     * @return $this
22
     */
23 68
    public function setConfig($data)
24
    {
25 68
        $this->config = $data;
26
27 68
        return $this;
28
    }
29
}
30