Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
28 | public function run($id) |
||
29 | { |
||
30 | $model = $this->findModel($id); |
||
31 | |||
32 | if ($this->checkAccess) { |
||
33 | call_user_func($this->checkAccess, $this->id, $model); |
||
34 | } |
||
35 | |||
36 | if ($model->delete() === false) { |
||
37 | throw new ServerErrorHttpException('Failed to delete the object for unknown reason.'); |
||
38 | } |
||
39 | |||
40 | Yii::$app->getResponse()->setStatusCode(204); |
||
|
|||
41 | } |
||
43 |