| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 32 | 2 | public function detachAll(HasAsset $model, ?string $type = null): void |
|
| 33 | { |
||
| 34 | 2 | $assetIds = $type |
|
| 35 | 1 | ? $model->assetRelation()->where('asset_pivots.type', $type)->get()->pluck('id') |
|
| 36 | 1 | : $model->assetRelation()->get()->pluck('id'); |
|
| 37 | |||
| 38 | 1 | $assetIds = $this->ensureIdsArePassedAsString($assetIds); |
|
| 39 | |||
| 40 | 2 | $model->assetRelation()->detach($assetIds); |
|
| 41 | } |
||
| 52 |