| @@ 25-103 (lines=79) @@ | ||
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | * @author Gorka Laucirica <[email protected]> |
|
| 24 | */ |
|
| 25 | final class UserRememberPasswordRequested implements UserEvent |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * The user id. |
|
| 29 | * |
|
| 30 | * @var UserId |
|
| 31 | */ |
|
| 32 | private $userId; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * The email. |
|
| 36 | * |
|
| 37 | * @var UserEmail |
|
| 38 | */ |
|
| 39 | private $email; |
|
| 40 | ||
| 41 | /** |
|
| 42 | * The occurred on. |
|
| 43 | * |
|
| 44 | * @var \DateTimeImmutable |
|
| 45 | */ |
|
| 46 | private $occurredOn; |
|
| 47 | ||
| 48 | /** |
|
| 49 | * The remember password token. |
|
| 50 | * |
|
| 51 | * @var UserToken |
|
| 52 | */ |
|
| 53 | private $rememberPasswordToken; |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Constructor. |
|
| 57 | * |
|
| 58 | * @param UserId $aUserId The user id |
|
| 59 | * @param UserEmail $anEmail The email |
|
| 60 | * @param UserToken $aRememberPasswordToken The remember password token |
|
| 61 | */ |
|
| 62 | public function __construct(UserId $aUserId, UserEmail $anEmail, UserToken $aRememberPasswordToken) |
|
| 63 | { |
|
| 64 | $this->userId = $aUserId; |
|
| 65 | $this->email = $anEmail; |
|
| 66 | $this->rememberPasswordToken = $aRememberPasswordToken; |
|
| 67 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * {@inheritdoc} |
|
| 72 | */ |
|
| 73 | public function id() |
|
| 74 | { |
|
| 75 | return $this->userId; |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * {@inheritdoc} |
|
| 80 | */ |
|
| 81 | public function email() |
|
| 82 | { |
|
| 83 | return $this->email; |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * {@inheritdoc} |
|
| 88 | */ |
|
| 89 | public function occurredOn() |
|
| 90 | { |
|
| 91 | return $this->occurredOn; |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * Gets the remember password token. |
|
| 96 | * |
|
| 97 | * @return UserToken |
|
| 98 | */ |
|
| 99 | public function rememberPasswordToken() |
|
| 100 | { |
|
| 101 | return $this->rememberPasswordToken; |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| @@ 24-102 (lines=79) @@ | ||
| 21 | * |
|
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | */ |
|
| 24 | final class UserRoleGranted implements UserEvent |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * The user id. |
|
| 28 | * |
|
| 29 | * @var UserId |
|
| 30 | */ |
|
| 31 | private $userId; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * The email. |
|
| 35 | * |
|
| 36 | * @var UserEmail |
|
| 37 | */ |
|
| 38 | private $email; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * The occurred on. |
|
| 42 | * |
|
| 43 | * @var \DateTimeImmutable |
|
| 44 | */ |
|
| 45 | private $occurredOn; |
|
| 46 | ||
| 47 | /** |
|
| 48 | * The granted role. |
|
| 49 | * |
|
| 50 | * @var UserRole |
|
| 51 | */ |
|
| 52 | private $grantedRole; |
|
| 53 | ||
| 54 | /** |
|
| 55 | * Constructor. |
|
| 56 | * |
|
| 57 | * @param UserId $aUserId The user id |
|
| 58 | * @param UserEmail $anEmail The email |
|
| 59 | * @param UserRole $aGrantedRole The granted role |
|
| 60 | */ |
|
| 61 | public function __construct(UserId $aUserId, UserEmail $anEmail, UserRole $aGrantedRole) |
|
| 62 | { |
|
| 63 | $this->userId = $aUserId; |
|
| 64 | $this->email = $anEmail; |
|
| 65 | $this->grantedRole = $aGrantedRole; |
|
| 66 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * {@inheritdoc} |
|
| 71 | */ |
|
| 72 | public function id() |
|
| 73 | { |
|
| 74 | return $this->userId; |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * {@inheritdoc} |
|
| 79 | */ |
|
| 80 | public function email() |
|
| 81 | { |
|
| 82 | return $this->email; |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * {@inheritdoc} |
|
| 87 | */ |
|
| 88 | public function occurredOn() |
|
| 89 | { |
|
| 90 | return $this->occurredOn; |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * Gets the granted role. |
|
| 95 | * |
|
| 96 | * @return UserRole |
|
| 97 | */ |
|
| 98 | public function role() |
|
| 99 | { |
|
| 100 | return $this->grantedRole; |
|
| 101 | } |
|
| 102 | } |
|
| 103 | ||
| @@ 24-102 (lines=79) @@ | ||
| 21 | * |
|
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | */ |
|
| 24 | final class UserRoleRevoked implements UserEvent |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * The user id. |
|
| 28 | * |
|
| 29 | * @var UserId |
|
| 30 | */ |
|
| 31 | private $userId; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * The email. |
|
| 35 | * |
|
| 36 | * @var UserEmail |
|
| 37 | */ |
|
| 38 | private $email; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * The occurred on. |
|
| 42 | * |
|
| 43 | * @var \DateTimeImmutable |
|
| 44 | */ |
|
| 45 | private $occurredOn; |
|
| 46 | ||
| 47 | /** |
|
| 48 | * The revoked role. |
|
| 49 | * |
|
| 50 | * @var UserRole |
|
| 51 | */ |
|
| 52 | private $revokedRole; |
|
| 53 | ||
| 54 | /** |
|
| 55 | * Constructor. |
|
| 56 | * |
|
| 57 | * @param UserId $aUserId The user id |
|
| 58 | * @param UserEmail $anEmail The email |
|
| 59 | * @param UserRole $aRevokedRole The revoked role |
|
| 60 | */ |
|
| 61 | public function __construct(UserId $aUserId, UserEmail $anEmail, UserRole $aRevokedRole) |
|
| 62 | { |
|
| 63 | $this->userId = $aUserId; |
|
| 64 | $this->email = $anEmail; |
|
| 65 | $this->revokedRole = $aRevokedRole; |
|
| 66 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * {@inheritdoc} |
|
| 71 | */ |
|
| 72 | public function id() |
|
| 73 | { |
|
| 74 | return $this->userId; |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * {@inheritdoc} |
|
| 79 | */ |
|
| 80 | public function email() |
|
| 81 | { |
|
| 82 | return $this->email; |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * {@inheritdoc} |
|
| 87 | */ |
|
| 88 | public function occurredOn() |
|
| 89 | { |
|
| 90 | return $this->occurredOn; |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * Gets the revoked role. |
|
| 95 | * |
|
| 96 | * @return UserRole |
|
| 97 | */ |
|
| 98 | public function role() |
|
| 99 | { |
|
| 100 | return $this->revokedRole; |
|
| 101 | } |
|
| 102 | } |
|
| 103 | ||
| @@ 24-102 (lines=79) @@ | ||
| 21 | * |
|
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | */ |
|
| 24 | final class UserInvited implements UserEvent |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * The user id. |
|
| 28 | * |
|
| 29 | * @var UserId |
|
| 30 | */ |
|
| 31 | private $userId; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * The user email. |
|
| 35 | * |
|
| 36 | * @var UserEmail |
|
| 37 | */ |
|
| 38 | private $email; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * The confirmation token. |
|
| 42 | * |
|
| 43 | * @var UserToken |
|
| 44 | */ |
|
| 45 | private $invitationToken; |
|
| 46 | ||
| 47 | /** |
|
| 48 | * The occurred on. |
|
| 49 | * |
|
| 50 | * @var \DateTimeImmutable |
|
| 51 | */ |
|
| 52 | private $occurredOn; |
|
| 53 | ||
| 54 | /** |
|
| 55 | * Constructor. |
|
| 56 | * |
|
| 57 | * @param UserId $aUserId The user id |
|
| 58 | * @param UserEmail $anEmail The email |
|
| 59 | * @param UserToken $anInvitationToken The invitation token |
|
| 60 | */ |
|
| 61 | public function __construct(UserId $aUserId, UserEmail $anEmail, UserToken $anInvitationToken) |
|
| 62 | { |
|
| 63 | $this->userId = $aUserId; |
|
| 64 | $this->email = $anEmail; |
|
| 65 | $this->invitationToken = $anInvitationToken; |
|
| 66 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * {@inheritdoc} |
|
| 71 | */ |
|
| 72 | public function id() |
|
| 73 | { |
|
| 74 | return $this->userId; |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * {@inheritdoc} |
|
| 79 | */ |
|
| 80 | public function email() |
|
| 81 | { |
|
| 82 | return $this->email; |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * {@inheritdoc} |
|
| 87 | */ |
|
| 88 | public function occurredOn() |
|
| 89 | { |
|
| 90 | return $this->occurredOn; |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * Gets the invitation token. |
|
| 95 | * |
|
| 96 | * @return UserToken |
|
| 97 | */ |
|
| 98 | public function invitationToken() |
|
| 99 | { |
|
| 100 | return $this->invitationToken; |
|
| 101 | } |
|
| 102 | } |
|
| 103 | ||
| @@ 25-103 (lines=79) @@ | ||
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | * @author Gorka Laucirica <[email protected]> |
|
| 24 | */ |
|
| 25 | final class UserRegistered implements UserEvent |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * The user id. |
|
| 29 | * |
|
| 30 | * @var UserId |
|
| 31 | */ |
|
| 32 | private $userId; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * The user email. |
|
| 36 | * |
|
| 37 | * @var UserEmail |
|
| 38 | */ |
|
| 39 | private $email; |
|
| 40 | ||
| 41 | /** |
|
| 42 | * The confirmation token. |
|
| 43 | * |
|
| 44 | * @var UserToken|null |
|
| 45 | */ |
|
| 46 | private $confirmationToken; |
|
| 47 | ||
| 48 | /** |
|
| 49 | * The occurred on. |
|
| 50 | * |
|
| 51 | * @var \DateTimeImmutable |
|
| 52 | */ |
|
| 53 | private $occurredOn; |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Constructor. |
|
| 57 | * |
|
| 58 | * @param UserId $aUserId The user id |
|
| 59 | * @param UserEmail $anEmail The email |
|
| 60 | * @param UserToken|null $aConfirmationToken The confirmation token |
|
| 61 | */ |
|
| 62 | public function __construct(UserId $aUserId, UserEmail $anEmail, UserToken $aConfirmationToken = null) |
|
| 63 | { |
|
| 64 | $this->userId = $aUserId; |
|
| 65 | $this->email = $anEmail; |
|
| 66 | $this->confirmationToken = $aConfirmationToken; |
|
| 67 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * {@inheritdoc} |
|
| 72 | */ |
|
| 73 | public function id() |
|
| 74 | { |
|
| 75 | return $this->userId; |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * {@inheritdoc} |
|
| 80 | */ |
|
| 81 | public function email() |
|
| 82 | { |
|
| 83 | return $this->email; |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * {@inheritdoc} |
|
| 88 | */ |
|
| 89 | public function occurredOn() |
|
| 90 | { |
|
| 91 | return $this->occurredOn; |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * Gets the confirmation token. |
|
| 96 | * |
|
| 97 | * @return UserToken|null |
|
| 98 | */ |
|
| 99 | public function confirmationToken() |
|
| 100 | { |
|
| 101 | return $this->confirmationToken; |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| @@ 24-102 (lines=79) @@ | ||
| 21 | * |
|
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | */ |
|
| 24 | final class UserInvitationTokenRegenerated implements UserEvent |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * The user id. |
|
| 28 | * |
|
| 29 | * @var UserId |
|
| 30 | */ |
|
| 31 | private $userId; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * The user email. |
|
| 35 | * |
|
| 36 | * @var UserEmail |
|
| 37 | */ |
|
| 38 | private $email; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * The confirmation token. |
|
| 42 | * |
|
| 43 | * @var UserToken |
|
| 44 | */ |
|
| 45 | private $invitationToken; |
|
| 46 | ||
| 47 | /** |
|
| 48 | * The occurred on. |
|
| 49 | * |
|
| 50 | * @var \DateTimeImmutable |
|
| 51 | */ |
|
| 52 | private $occurredOn; |
|
| 53 | ||
| 54 | /** |
|
| 55 | * Constructor. |
|
| 56 | * |
|
| 57 | * @param UserId $aUserId The user id |
|
| 58 | * @param UserEmail $anEmail The email |
|
| 59 | * @param UserToken $anInvitationToken The invitation token |
|
| 60 | */ |
|
| 61 | public function __construct(UserId $aUserId, UserEmail $anEmail, UserToken $anInvitationToken) |
|
| 62 | { |
|
| 63 | $this->userId = $aUserId; |
|
| 64 | $this->email = $anEmail; |
|
| 65 | $this->invitationToken = $anInvitationToken; |
|
| 66 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * {@inheritdoc} |
|
| 71 | */ |
|
| 72 | public function id() |
|
| 73 | { |
|
| 74 | return $this->userId; |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * {@inheritdoc} |
|
| 79 | */ |
|
| 80 | public function email() |
|
| 81 | { |
|
| 82 | return $this->email; |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * {@inheritdoc} |
|
| 87 | */ |
|
| 88 | public function occurredOn() |
|
| 89 | { |
|
| 90 | return $this->occurredOn; |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * Gets the invitation token. |
|
| 95 | * |
|
| 96 | * @return UserToken |
|
| 97 | */ |
|
| 98 | public function invitationToken() |
|
| 99 | { |
|
| 100 | return $this->invitationToken; |
|
| 101 | } |
|
| 102 | } |
|
| 103 | ||