Skip to content

Commit

Permalink
feat: mail provider backend
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Jul 13, 2024
1 parent b1f6e45 commit ff4903b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/private/Mail/Provider/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ public function providers(): array {
*
* @return IProvider|null
*/
public function findProviderById(string $id): IProvider | null {
public function findProviderById(string $providerId): IProvider | null {

// evaluate if we already have a cached collection of providers
if (!is_array($this->providersCollection)) {
$this->providers();
}

if (isset($this->providersCollection[$id])) {
return $this->providersCollection[$id];
if (isset($this->providersCollection[$providerId])) {
return $this->providersCollection[$providerId];
}
// return null if provider was not found
return null;
Expand Down
2 changes: 1 addition & 1 deletion lib/public/Mail/Provider/IMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function setReplyTo(IAddress $value): self;
*
* @since 30.0.0
*
* @param IAddress|null sender's mail address object
* @param IAddress|null sender's reply to mail address object
*/
public function getReplyTo(): IAddress | null;

Expand Down
18 changes: 9 additions & 9 deletions lib/public/Mail/Provider/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Message implements \OCP\Mail\Provider\IMessage {
*
* @since 30.0.0
*
* @param array|null $data message data array
* @param array $data message data array
*/
public function __construct(
protected array $data = [],
Expand All @@ -39,7 +39,7 @@ public function __construct(
*/
public function id(): string {
// return id of message
return (isset($this->data['id'])) ? $this->data['id'] : null;
return (isset($this->data['id'])) ? $this->data['id'] : '';
}

/**
Expand Down Expand Up @@ -91,7 +91,7 @@ public function setReplyTo(IAddress $value): self {
*
* @since 30.0.0
*
* @param IAddress|null sender's mail address object
* @param IAddress|null sender's reply to mail address object
*/
public function getReplyTo(): IAddress | null {
// evaluate if data store field exists and return value(s) or null otherwise
Expand Down Expand Up @@ -284,9 +284,9 @@ public function getBodyHtml(): string | null {
*
* @since 30.0.0
*
* @param string $value plain text body of message
* @param string $value plain text body of message
*
* @return self return this object for command chaining
* @return self return this object for command chaining
*/
public function setBodyPlain(string $value): self {
// create or update field in data store with value
Expand All @@ -300,7 +300,7 @@ public function setBodyPlain(string $value): self {
*
* @since 30.0.0
*
* @param string|null plain text body of this message or null if one is not set
* @param string|null plain text body of this message or null if one is not set
*/
public function getBodyPlain(): string | null {
// evaluate if data store field exists and return value(s) or null otherwise
Expand All @@ -312,9 +312,9 @@ public function getBodyPlain(): string | null {
*
* @since 30.0.0
*
* @param IAttachment ...$value collection of or one or more mail attachment objects
* @param IAttachment ...$value collection of or one or more mail attachment objects
*
* @return self return this object for command chaining
* @return self return this object for command chaining
*/
public function setAttachments(IAttachment ...$value): self {
// create or update field in data store with value
Expand All @@ -328,7 +328,7 @@ public function setAttachments(IAttachment ...$value): self {
*
* @since 30.0.0
*
* @return array<int,IAttachment> collection of all mail attachment objects
* @return array<int,IAttachment> collection of all mail attachment objects
*/
public function getAttachments(): array {
// evaluate if data store field exists and return value(s) or null otherwise
Expand Down

0 comments on commit ff4903b

Please sign in to comment.