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