Conditions | 5 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function run($id) |
||
21 | { |
||
22 | $model = $this->controller->findModel($id); |
||
23 | $model->delete(); |
||
24 | if ($model->hasErrors() || $this->hasSoftDeleteError($model)) { |
||
25 | $msg = current($model->getFirstErrors()); |
||
26 | Yii::$app->session->setFlash('error', $msg ?: Yii::t('errors', 'Fail Deleting Model')); |
||
|
|||
27 | } else { |
||
28 | Yii::$app->session->setFlash('success', Yii::t('messages', 'Model deleted')); |
||
29 | } |
||
30 | |||
31 | if (Yii::$app->request->isAjax) { |
||
32 | return Yii::$app->response->redirect(Yii::$app->request->referrer, 302, false); |
||
33 | } |
||
34 | |||
35 | return $this->controller->redirect($this->controller->deleteRedirect($model)); |
||
36 | } |
||
49 | } |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.