Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function actionIndex() |
||
12 | { |
||
13 | $model = new SettingsForm(); |
||
14 | |||
15 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
||
16 | Yii::$app->getSession()->setFlash('success', 'Settings successfully updated!'); |
||
|
|||
17 | return $this->refresh(); |
||
18 | } |
||
19 | |||
20 | return $this->render('settings', [ |
||
21 | 'model' => $model, |
||
22 | ]); |
||
23 | } |
||
24 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: