-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: use task processing to send emails #55968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
2e53963 to
fa0c16e
Compare
| * | ||
| * @param array array representation of this object | ||
| */ | ||
| public function jsonDeserialize(array|string $data): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a static function returning a new instance like https://github.com/nextcloud/mail/blob/1c24b8cf306f56ce5cbe2a86fb811a395ddd53fd/lib/Address.php#L32-L43 instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! yes, good point!
Done
| */ | ||
| interface JsonDeserializable { | ||
|
|
||
| public function jsonDeserialize(array|string $data): static; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer a static method because the dynamic method needs object instantiation first. That is not an option for objects with required constructor arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that on purpose, to preserve DI functionality. If we use the static object building pattern, we can't inject any service a object might need like L10N.
So what would you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The static method. Data objects should not use DI. DI is for services.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ChristophWurst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit unsure about static vs just using self but looks good otherwise 👍 ![]()
This change adds a new public API: the json deserialize interface. This means the developer documentation has to be extended. |
b9116e9 to
17648f0
Compare
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
17648f0 to
f158d33
Compare
Summary
Checklist
3. to review, feature component)stable32)