| 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 | 18 | public function create(Model $model, string $key, string $cast, $value): Setting |
|
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var HasSettings $model |
||
| 24 | * @var Setting $setting |
||
| 25 | */ |
||
| 26 | 18 | $setting = $model->settings() |
|
| 27 | 18 | ->create(\compact('key', 'cast', 'value')); |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @var Collection $collection |
||
| 31 | */ |
||
| 32 | 18 | $collection = $model->settings; |
|
| 33 | 18 | $collection->push($setting); |
|
| 34 | |||
| 35 | 18 | return $setting; |
|
| 36 | } |
||
| 68 |