1 | <?php |
||
11 | class ChangePasswordForm extends Model |
||
12 | { |
||
13 | use CommonTrait; |
||
14 | |||
15 | /** |
||
16 | * @var string old user password |
||
17 | */ |
||
18 | public $oldPassword; |
||
19 | |||
20 | /** |
||
21 | * @var string new user password |
||
22 | */ |
||
23 | public $newPassword; |
||
24 | |||
25 | /** @inheritdoc */ |
||
26 | public function attributeLabels() |
||
33 | |||
34 | /** @inheritdoc */ |
||
35 | public function rules() |
||
46 | |||
47 | /** |
||
48 | * Validates form and logs the user in. |
||
49 | * @return bool whether the user is logged in successfully |
||
50 | */ |
||
51 | public function changePassword() |
||
62 | |||
63 | /** |
||
64 | * Reset from fields |
||
65 | */ |
||
66 | public function reset() |
||
70 | } |
||
71 |
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: