Total Complexity | 4 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php namespace AgelxNash\Modx\Evo\Database\Traits; |
||
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) |
|
28 | } |
||
29 | } |
||
30 |