| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | 5 | public function detach(HasAsset $model, $ids, $type, $locale): void |
|
| 15 | { |
||
| 16 | 5 | if (! is_array($ids)) { |
|
| 17 | 4 | $ids = (array) $ids; |
|
| 18 | } |
||
| 19 | |||
| 20 | 5 | $ids = $this->ensureIdsArePassedAsString($ids); |
|
| 21 | 5 | ||
| 22 | foreach ($ids as $id) { |
||
| 23 | 5 | $model->assetRelation()->where('asset_pivots.type', $type)->where('asset_pivots.locale', $locale)->detach($id); |
|
| 24 | } |
||
| 52 |