Conditions | 4 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function deleted(PageModel $pageModel) |
||
25 | { |
||
26 | Log::info('Deleting all data from the page internal id: ' . $pageModel->id); |
||
27 | DB::transaction(function () use($pageModel){ |
||
28 | try { |
||
29 | $characteristic = CharacteristicsModel::query()->where('page_id', $pageModel->page_id)->first(); |
||
30 | if (isset($characteristic)) { |
||
31 | $characteristic->delete(); |
||
32 | if (is_file($characteristic->picturePath())) { |
||
33 | unlink($characteristic->picturePath()); |
||
34 | } |
||
35 | |||
36 | UserCharacteristicsModel::query()->where('characteristic_id', $characteristic->id)->delete(); |
||
37 | } |
||
38 | } catch (\Throwable $e) { |
||
39 | Log::emergency('Error deleting all data from the page internal id: ' . $pageModel->id); |
||
40 | throw $e; |
||
41 | } |
||
55 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.