| 1 | <?php |
||
| 7 | class SettingsAction extends Action |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string class name of the model which will be used to validate the attributes. |
||
| 11 | * The class should have a scenario matching the `scenario` variable. |
||
| 12 | * The model class must implement [[Model]]. |
||
| 13 | * This property must be set. |
||
| 14 | */ |
||
| 15 | public $modelClass; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string The scenario this model should use to make validation |
||
| 19 | */ |
||
| 20 | public $scenario; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string the name of the view to generate the form. Defaults to 'settings'. |
||
| 24 | */ |
||
| 25 | public $viewName = 'settings'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Render the settings form. |
||
| 29 | */ |
||
| 30 | public function run() |
||
| 52 | } |
||
| 53 |
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: