| Total Complexity | 6 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Coverage | 86.67% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | class DbStorage extends BaseObject implements StorageInterface |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var Connection|array|string |
||
| 25 | */ |
||
| 26 | public $db = 'db'; |
||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | public $tableName = '{{%settings}}'; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Initializes the application component. |
||
| 34 | */ |
||
| 35 | 1 | public function init() |
|
| 36 | { |
||
| 37 | 1 | parent::init(); |
|
| 38 | 1 | $this->db = Instance::ensure($this->db, Connection::class); |
|
| 39 | 1 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @param string $key |
||
| 43 | * @return false|null|string |
||
| 44 | */ |
||
| 45 | 1 | public function getValue($key) |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param string $key |
||
| 58 | * @param string $value |
||
| 59 | * @return bool |
||
| 60 | */ |
||
| 61 | 1 | public function setValue($key, $value) |
|
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @param string $key |
||
| 85 | * @return bool |
||
| 86 | */ |
||
| 87 | 1 | public function deleteValue($key) |
|
| 96 |