Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
20 | public function delete($id) |
||
21 | { |
||
22 | $model = $this->findModel($id); |
||
23 | |||
24 | if ($this->checkAccess) { |
||
25 | call_user_func($this->checkAccess, $this->id, $model); |
||
26 | } |
||
27 | |||
28 | if ($this->deleteModel($model) === false) { |
||
|
|||
29 | throw new ServerErrorHttpException('Failed to delete the object for unknown reason.'); |
||
30 | } |
||
31 | |||
32 | Yii::$app->getResponse()->setStatusCode(204); |
||
33 | } |
||
48 |