1 | <?php |
||
2 | |||
3 | namespace sample\models; |
||
4 | |||
5 | use yii\base\Model; |
||
6 | |||
7 | /** |
||
8 | * AccountSelectionForm is the model behind the OpenID Connect user account selection form. |
||
9 | * |
||
10 | * @property-read User|null $user This property is read-only. |
||
11 | * |
||
12 | */ |
||
13 | class AccountSelectionForm extends Model |
||
14 | { |
||
15 | /** |
||
16 | * ID of the selected identity |
||
17 | * @var int|null |
||
18 | */ |
||
19 | public $identityId = null; |
||
20 | |||
21 | /** |
||
22 | * Helper property to access current user identity (not set via user input) |
||
23 | * @var User|null |
||
24 | */ |
||
25 | public $user = null; |
||
26 | |||
27 | /** |
||
28 | * @return array the validation rules. |
||
29 | */ |
||
30 | public function rules() |
||
31 | { |
||
32 | return [ |
||
33 | ['identityId', 'required'], |
||
34 | ['identityId', 'integer'], |
||
35 | ['identityId', function ($attribute) { |
||
36 | if (!$this->user->hasLinkedIdentity($this->$attribute)) { |
||
0 ignored issues
–
show
|
|||
37 | $this->addError( |
||
38 | $attribute, |
||
39 | 'The current user does not have access to account ' . $this->$attribute |
||
40 | ); |
||
41 | } |
||
42 | }], |
||
43 | ]; |
||
44 | } |
||
45 | } |
||
46 |
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.