| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 9 | public function getSettingsValue(): array |
|
| 33 | { |
||
| 34 | 9 | $settingsFieldName = $this->getSettingsFieldName(); |
|
| 35 | 9 | $attributes = $this->getAttributes(); |
|
| 36 | 9 | if (!array_has($attributes, $settingsFieldName)) { |
|
| 37 | 2 | throw new ModelSettingsException("Unknown field ($settingsFieldName) on table {$this->getTable()}"); |
|
| 38 | } |
||
| 39 | 7 | return json_decode($this->getAttributeValue($settingsFieldName) ?? '[]', true); |
|
| 40 | } |
||
| 54 |