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