Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
35 | 2 | public function set($key, $value) |
|
36 | { |
||
37 | 2 | $aKey = Key::fromString($key); |
|
38 | 2 | $aValue = Value::fromString($value); |
|
39 | |||
40 | 2 | $setting = $this->find($aKey); |
|
41 | |||
42 | 2 | if (null === $setting) { |
|
43 | 1 | $setting = Setting::issue($aKey, $aValue, $this->section); |
|
44 | } |
||
45 | |||
46 | 2 | $setting->changeValue($aValue); |
|
47 | |||
48 | 2 | $this->settingRepository->save($setting); |
|
49 | 2 | } |
|
50 | |||
60 |