1 | <?php |
||
8 | abstract class ResetPassword extends \yii\base\model |
||
9 | { |
||
10 | const SCENARIO_INIT = 'init'; |
||
11 | const SCENARIO_RESET = 'reset'; |
||
12 | |||
13 | const EXPIRY_TIME = '+4 hours'; |
||
14 | |||
15 | /** |
||
16 | * The email |
||
17 | * @var string $email |
||
18 | */ |
||
19 | public $email; |
||
20 | |||
21 | /** |
||
22 | * The reset token |
||
23 | * @var string $reset_token |
||
24 | */ |
||
25 | public $reset_token; |
||
26 | |||
27 | /** |
||
28 | * The new password |
||
29 | * @var string $password |
||
30 | */ |
||
31 | public $password; |
||
32 | |||
33 | /** |
||
34 | * The new password (again) |
||
35 | * @var string $password_verify |
||
36 | */ |
||
37 | public $password_verify; |
||
38 | |||
39 | /** |
||
40 | * The user associated to the email |
||
41 | * @var User $user |
||
42 | */ |
||
43 | private $user = null; |
||
44 | |||
45 | /** |
||
46 | * Validation scenarios |
||
47 | * @return array |
||
48 | */ |
||
49 | public function scenarios() |
||
56 | |||
57 | /** |
||
58 | * Validation rules |
||
59 | * @return array |
||
60 | */ |
||
61 | public function rules() |
||
74 | |||
75 | /** |
||
76 | * Validates the users email |
||
77 | * @inheritdoc |
||
78 | */ |
||
79 | public function validateUser($attributes, $params) |
||
89 | |||
90 | /** |
||
91 | * Reset token validator |
||
92 | * @inheritdoc |
||
93 | */ |
||
94 | public function validateResetToken($attributes, $params) |
||
112 | |||
113 | /** |
||
114 | * Sets the user object |
||
115 | * @param User $user |
||
116 | */ |
||
117 | public function setUser($user) |
||
122 | |||
123 | /** |
||
124 | * Changes the password for the user |
||
125 | * @return boolean |
||
126 | */ |
||
127 | public function reset() |
||
150 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.