Conditions | 6 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function run($id) |
||
24 | { |
||
25 | $model = $this->controller->findModel($id); |
||
26 | $model->delete(); |
||
27 | if ($model->hasErrors() || $this->hasSoftDeleteError($model)) { |
||
28 | $msg = current($model->getFirstErrors()); |
||
29 | Yii::$app->session->setFlash('error', $msg ?: Yii::t('errors', 'Fail Deleting Model')); |
||
|
|||
30 | } else { |
||
31 | Yii::$app->session->setFlash('success', $this->getMessageOnDelete($model)); |
||
32 | } |
||
33 | |||
34 | if (Yii::$app->request->isAjax && !$this->preventAjaxRedirect) { |
||
35 | return Yii::$app->response->redirect($this->controller->deleteRedirect($model), 302, false); |
||
36 | } |
||
37 | |||
38 | return $this->controller->redirect($this->controller->deleteRedirect($model)); |
||
39 | } |
||
52 | } |
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.