Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
20 | 19 | public function create(Model $model, string $key, string $cast, $value): Setting |
|
21 | { |
||
22 | /** |
||
23 | * @var HasSettings $model |
||
24 | * @var Setting $setting |
||
25 | */ |
||
26 | 19 | $setting = $model->settings() |
|
27 | 19 | ->create(\compact('key', 'cast', 'value')); |
|
28 | |||
29 | /** |
||
30 | * @var Collection $collection |
||
31 | */ |
||
32 | 19 | $collection = $model->settings; |
|
33 | 19 | $collection->push($setting); |
|
34 | |||
35 | 19 | return $setting; |
|
36 | } |
||
64 |