diff --git a/src/Exception/UserNotVerifiedException.php b/src/Exception/UserNotVerifiedException.php new file mode 100644 index 0000000..afc4460 --- /dev/null +++ b/src/Exception/UserNotVerifiedException.php @@ -0,0 +1,63 @@ +identifier; + } + + /** + * Set the user identifier (e.g. username or email address). + */ + public function setUserIdentifier(string $identifier): void + { + $this->identifier = $identifier; + } + + /** + * {@inheritdoc} + */ + #[ArrayShape(shape: ['{{ username }}' => "null|string", '{{ user_identifier }}' => "null|string"])] + public function getMessageData(): array + { + return ['{{ username }}' => $this->identifier, '{{ user_identifier }}' => $this->identifier]; + } + + /** + * {@inheritdoc} + */ + public function __serialize(): array + { + return [$this->identifier, parent::__serialize()]; + } + + /** + * {@inheritdoc} + */ + public function __unserialize(array $data): void + { + [$this->identifier, $parentData] = $data; + $parentData = is_array(value: $parentData) ? $parentData : unserialize(data: $parentData); + parent::__unserialize(data: $parentData); + } +}