Conditions | 7 |
Paths | 12 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function run() |
||
28 | { |
||
29 | /** |
||
30 | * @var ActiveRecord $class |
||
31 | * @var ActiveRecord $model |
||
32 | */ |
||
33 | $class = $this->modelClass ?: ($this->controller->createClass ?: $this->controller->modelClass); |
||
34 | $model = new $class(); |
||
35 | $this->controller->beforeCreate($model); |
||
36 | if ($this->loadDefaultValues) { |
||
37 | $model->loadDefaultValues($this->skipIfSet); |
||
38 | } |
||
39 | if ($this->loadGetParams) { |
||
40 | $model->load(\Yii::$app->request->get()); |
||
41 | } |
||
42 | if ($model->load(Yii::$app->request->post())) { |
||
43 | if ($model->save()) { |
||
44 | Yii::$app->session->setFlash('success', $this->getMessageOnCreate($model)); |
||
|
|||
45 | return $this->controller->redirect($this->controller->createRedirect($model)); |
||
46 | } |
||
47 | Yii::$app->session->setFlash('error', Html::errorSummary($model)); |
||
48 | } |
||
49 | return $this->controller->render($this->view, ['model' => $model]); |
||
50 | } |
||
51 | } |
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.