| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function run($id) |
||
| 26 | { |
||
| 27 | /** @var BaseActiveRecord $model */ |
||
| 28 | $model = $this->findModel($id); |
||
| 29 | |||
| 30 | if ($this->checkAccess) { |
||
| 31 | call_user_func($this->checkAccess, $this->id, $model); |
||
| 32 | } |
||
| 33 | |||
| 34 | if ($model->delete() === false) { |
||
| 35 | throw new ServerErrorHttpException('Failed to delete the resource for unknown reason.'); |
||
| 36 | } |
||
| 37 | |||
| 38 | Yii::$app->getResponse()->setStatusCode(204); |
||
| 39 | } |
||
| 40 | } |