| @@ 12-45 (lines=34) @@ | ||
| 9 | * |
|
| 10 | * @author Hugues Maignol <[email protected]> |
|
| 11 | */ |
|
| 12 | final class ChangeEmail extends UserCommand |
|
| 13 | { |
|
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | private $email; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @var Identity |
|
| 21 | */ |
|
| 22 | private $userId; |
|
| 23 | ||
| 24 | public function __construct(string $email, Identity $userId) |
|
| 25 | { |
|
| 26 | $this->email = $email; |
|
| 27 | $this->userId = $userId; |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @return string |
|
| 32 | */ |
|
| 33 | public function getEmail(): string |
|
| 34 | { |
|
| 35 | return $this->email; |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * @return Identity |
|
| 40 | */ |
|
| 41 | public function getUserId(): Identity |
|
| 42 | { |
|
| 43 | return $this->userId; |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| @@ 13-48 (lines=36) @@ | ||
| 10 | * |
|
| 11 | * @author Hugues Maignol <[email protected]> |
|
| 12 | */ |
|
| 13 | final class EmailConfirmed extends UserEvent |
|
| 14 | { |
|
| 15 | /** |
|
| 16 | * @var Identity |
|
| 17 | */ |
|
| 18 | private $userId; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var string |
|
| 22 | */ |
|
| 23 | private $email; |
|
| 24 | ||
| 25 | public function __construct(Identity $userId, string $email) |
|
| 26 | { |
|
| 27 | $this->userId = $userId; |
|
| 28 | $this->email = $email; |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * Getter de email |
|
| 33 | * |
|
| 34 | * @return string |
|
| 35 | */ |
|
| 36 | public function getEmail() |
|
| 37 | { |
|
| 38 | return $this->email; |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @return Identity |
|
| 43 | */ |
|
| 44 | public function getUserId(): Identity |
|
| 45 | { |
|
| 46 | return $this->userId; |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||
| @@ 13-48 (lines=36) @@ | ||
| 10 | * |
|
| 11 | * @author Hugues Maignol <[email protected]> |
|
| 12 | */ |
|
| 13 | final class PasswordResetRequested extends UserEvent |
|
| 14 | { |
|
| 15 | /** |
|
| 16 | * @var Identity |
|
| 17 | */ |
|
| 18 | private $userId; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var string |
|
| 22 | */ |
|
| 23 | private $resetToken; |
|
| 24 | ||
| 25 | public function __construct(Identity $userId, string $resetToken) |
|
| 26 | { |
|
| 27 | $this->userId = $userId; |
|
| 28 | $this->resetToken = $resetToken; |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * Getter de resetToken |
|
| 33 | * |
|
| 34 | * @return string |
|
| 35 | */ |
|
| 36 | public function getResetToken() |
|
| 37 | { |
|
| 38 | return $this->resetToken; |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @return Identity |
|
| 43 | */ |
|
| 44 | public function getUserId(): Identity |
|
| 45 | { |
|
| 46 | return $this->userId; |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||