feat: use task processing to send emails#55968
feat: use task processing to send emails#55968SebastianKrupinski wants to merge 1 commit intomasterfrom
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.
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.
Ah! yes, good point!
Done
| */ | ||
| interface JsonDeserializable { | ||
|
|
||
| public function jsonDeserialize(array|string $data): static; |
There was a problem hiding this comment.
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.
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.
The static method. Data objects should not use DI. DI is for services.
ChristophWurst
left a comment
There was a problem hiding this comment.
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)