|
2 | 2 |
|
3 | 3 | namespace BNETDocs\Models\User; |
4 | 4 |
|
5 | | -class ResetPassword extends \BNETDocs\Models\ActiveUser |
| 5 | +class ResetPassword extends \BNETDocs\Models\Core\HttpForm implements \JsonSerializable |
6 | 6 | { |
7 | | - public const E_BAD_EMAIL = 'BAD_EMAIL'; |
8 | | - public const E_BAD_TOKEN = 'BAD_TOKEN'; |
9 | | - public const E_EMPTY_EMAIL = 'EMPTY_EMAIL'; |
10 | | - public const E_SUCCESS = 'SUCCESS'; |
11 | | - public const E_INTERNAL_ERROR = 'INTERNAL_ERROR'; |
12 | | - public const E_PASSWORD_CONTAINS_EMAIL = 'PASSWORD_CONTAINS_EMAIL'; |
13 | | - public const E_PASSWORD_CONTAINS_USERNAME = 'PASSWORD_CONTAINS_USERNAME'; |
14 | | - public const E_PASSWORD_MISMATCH = 'PASSWORD_MISMATCH'; |
15 | | - public const E_PASSWORD_TOO_LONG = 'PASSWORD_TOO_LONG'; |
16 | | - public const E_PASSWORD_TOO_SHORT = 'PASSWORD_TOO_SHORT'; |
17 | | - public const E_USER_DISABLED = 'USER_DISABLED'; |
18 | | - public const E_USER_NOT_FOUND = 'USER_NOT_FOUND'; |
| 7 | + public const E_BAD_EMAIL = 'BAD_EMAIL'; |
| 8 | + public const E_BAD_TOKEN = 'BAD_TOKEN'; |
| 9 | + public const E_EMPTY_EMAIL = 'EMPTY_EMAIL'; |
| 10 | + public const E_SUCCESS = 'SUCCESS'; |
| 11 | + public const E_INTERNAL_ERROR = 'INTERNAL_ERROR'; |
| 12 | + public const E_PASSWORD_CONTAINS_EMAIL = 'PASSWORD_CONTAINS_EMAIL'; |
| 13 | + public const E_PASSWORD_CONTAINS_USERNAME = 'PASSWORD_CONTAINS_USERNAME'; |
| 14 | + public const E_PASSWORD_MISMATCH = 'PASSWORD_MISMATCH'; |
| 15 | + public const E_PASSWORD_TOO_LONG = 'PASSWORD_TOO_LONG'; |
| 16 | + public const E_PASSWORD_TOO_SHORT = 'PASSWORD_TOO_SHORT'; |
| 17 | + public const E_USER_DISABLED = 'USER_DISABLED'; |
| 18 | + public const E_USER_NOT_FOUND = 'USER_NOT_FOUND'; |
19 | 19 |
|
20 | | - public $email; |
21 | | - public $form_fields; |
22 | | - public $pw1; |
23 | | - public $pw2; |
24 | | - public $token; |
25 | | - public $user; |
| 20 | + public ?string $email = null; |
| 21 | + public ?string $pw1 = null; |
| 22 | + public ?string $pw2 = null; |
| 23 | + public ?string $token = null; |
| 24 | + public ?\BNETDocs\Libraries\User\User $user = null; |
| 25 | + |
| 26 | + public function jsonSerialize(): mixed |
| 27 | + { |
| 28 | + return \array_merge(parent::jsonSerialize(), [ |
| 29 | + 'email' => $this->email, |
| 30 | + 'pw1' => $this->pw1, |
| 31 | + 'pw2' => $this->pw2, |
| 32 | + 'token' => $this->token, |
| 33 | + 'user' => $this->user, |
| 34 | + ]); |
| 35 | + } |
26 | 36 | } |
0 commit comments