| Total Complexity | 11 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Settings extends Collection |
||
| 10 | { |
||
| 11 | private $values; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * |
||
| 15 | */ |
||
| 16 | public static function init() |
||
| 17 | { |
||
| 18 | $configValues = static::configValues(); |
||
|
|
|||
| 19 | } |
||
| 20 | |||
| 21 | public function get($key, $locale = null, $default = null) |
||
| 22 | { |
||
| 23 | $this->fetch(); |
||
| 24 | |||
| 25 | if (! isset($this->values[$key])) { |
||
| 26 | return $default; |
||
| 27 | } |
||
| 28 | |||
| 29 | if (is_array($this->values[$key])) { |
||
| 30 | if ($this->values[$key]['value'] == null) { |
||
| 31 | return $default; |
||
| 32 | } |
||
| 33 | |||
| 34 | return $this->values[$key]['value']; |
||
| 35 | } |
||
| 36 | |||
| 37 | return $this->values[$key]; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function set($key, $value) |
||
| 43 | } |
||
| 44 | |||
| 45 | private static function configValues(): array |
||
| 48 | } |
||
| 49 | |||
| 50 | private function fetch() |
||
| 63 | } |
||
| 64 | |||
| 65 | public function fresh() |
||
| 72 |