Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
44 | 2 | public function delete(Model $model, string $key): bool |
|
45 | { |
||
46 | 2 | $setting = app(ReadableService::class) |
|
47 | 2 | ->getSetting($model, $key); |
|
48 | |||
49 | 2 | if ($setting) { |
|
50 | 2 | foreach ($model->settings as $index => $item) { |
|
51 | 2 | if ($item === $setting) { |
|
52 | 2 | $model->settings->forget($index); |
|
53 | 2 | break; |
|
54 | } |
||
55 | } |
||
56 | |||
57 | 2 | return $setting->delete(); |
|
58 | } |
||
59 | |||
60 | 2 | return false; |
|
61 | } |
||
64 |