1 | <?php |
||
22 | class SettingsForm extends Model |
||
23 | { |
||
24 | use ModuleAwareTrait; |
||
25 | use ContainerAwareTrait; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | public $email; |
||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | public $username; |
||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | public $new_password; |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | public $current_password; |
||
43 | /** |
||
44 | * @var SecurityHelper |
||
45 | */ |
||
46 | protected $securityHelper; |
||
47 | |||
48 | /** @var User */ |
||
49 | protected $user; |
||
50 | |||
51 | 1 | public function __construct(SecurityHelper $securityHelper, array $config = []) |
|
|
|||
52 | { |
||
53 | 1 | $this->securityHelper = $securityHelper; |
|
54 | $config = [ |
||
55 | 1 | 'username' => $this->getUser()->username, |
|
56 | 1 | 'email' => $this->getUser()->unconfirmed_email? : $this->getUser()->email |
|
57 | ]; |
||
58 | 1 | parent::__construct($config); |
|
59 | 1 | } |
|
60 | |||
61 | /** |
||
62 | * @return array |
||
63 | */ |
||
64 | 1 | public function rules() |
|
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | 1 | public function attributeLabels() |
|
107 | |||
108 | /** |
||
109 | * @return User|null|\yii\web\IdentityInterface |
||
110 | */ |
||
111 | 1 | public function getUser() |
|
119 | |||
120 | /** |
||
121 | * Saves new account settings. |
||
122 | * |
||
123 | * @return bool |
||
124 | */ |
||
125 | 1 | public function save() |
|
150 | } |
||
151 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.