ConfigTrait::setConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
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