| @@ 9-56 (lines=48) @@ | ||
| 6 | ||
| 7 | use HMLB\DDD\Entity\Identity; |
|
| 8 | ||
| 9 | final class PasswordChanged extends UserEvent |
|
| 10 | { |
|
| 11 | /** |
|
| 12 | * @var Identity |
|
| 13 | */ |
|
| 14 | private $userId; |
|
| 15 | ||
| 16 | /** |
|
| 17 | * @var string |
|
| 18 | */ |
|
| 19 | private $oldPassword; |
|
| 20 | ||
| 21 | /** |
|
| 22 | * @var string |
|
| 23 | */ |
|
| 24 | private $newPassword; |
|
| 25 | ||
| 26 | public function __construct(Identity $userId, string $oldPassword, string $newPassword) |
|
| 27 | { |
|
| 28 | $this->userId = $userId; |
|
| 29 | $this->oldPassword = $oldPassword; |
|
| 30 | $this->newPassword = $newPassword; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @return string |
|
| 35 | */ |
|
| 36 | public function getOldPassword(): string |
|
| 37 | { |
|
| 38 | return $this->oldPassword; |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @return string |
|
| 43 | */ |
|
| 44 | public function getNewPassword(): string |
|
| 45 | { |
|
| 46 | return $this->newPassword; |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * @return Identity |
|
| 51 | */ |
|
| 52 | public function getUserId(): Identity |
|
| 53 | { |
|
| 54 | return $this->userId; |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| @@ 14-61 (lines=48) @@ | ||
| 11 | * |
|
| 12 | * @author Hugues Maignol <[email protected]> |
|
| 13 | */ |
|
| 14 | final class PasswordReset extends UserEvent |
|
| 15 | { |
|
| 16 | /** |
|
| 17 | * @var Identity |
|
| 18 | */ |
|
| 19 | private $userId; |
|
| 20 | ||
| 21 | /** |
|
| 22 | * @var string |
|
| 23 | */ |
|
| 24 | private $oldPassword; |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @var string |
|
| 28 | */ |
|
| 29 | private $newPassword; |
|
| 30 | ||
| 31 | public function __construct(Identity $userId, string $oldPassword, string $newPassword) |
|
| 32 | { |
|
| 33 | $this->userId = $userId; |
|
| 34 | $this->oldPassword = $oldPassword; |
|
| 35 | $this->newPassword = $newPassword; |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * @return string |
|
| 40 | */ |
|
| 41 | public function getOldPassword(): string |
|
| 42 | { |
|
| 43 | return $this->oldPassword; |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * @return string |
|
| 48 | */ |
|
| 49 | public function getNewPassword(): string |
|
| 50 | { |
|
| 51 | return $this->newPassword; |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * @return Identity |
|
| 56 | */ |
|
| 57 | public function getUserId(): Identity |
|
| 58 | { |
|
| 59 | return $this->userId; |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||