Total Complexity | 12 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 195 | trait HasSettings |
|
14 | 189 | { |
|
15 | 6 | public function getRules(): array |
|
22 | } |
||
23 | |||
24 | public function getDefaultSettings(): array |
||
25 | { |
||
26 | if (property_exists($this, 'defaultSettings') |
||
27 | && is_array($this->defaultSettings)) { |
||
28 | return Arr::wrap($this->defaultSettings); |
||
29 | } elseif (($defaultSettings = config('model_settings.defaultSettings.' . $this->getTable())) |
||
30 | && is_array($defaultSettings)) { |
||
31 | return Arr::wrap($defaultSettings); |
||
32 | } |
||
33 | |||
34 | return []; |
||
35 | } |
||
36 | |||
37 | public function __call($name, $args) |
||
44 | } |
||
45 | |||
46 | abstract public function getSettingsValue(): array; |
||
47 | |||
48 | abstract public function settings(): SettingsManagerContract; |
||
49 | } |
||
50 |