mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Adds same object return annotations.
Based on: https://github.com/nextcloud/server/pull/38987#discussion_r1241866676 Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Faraz Samapoor <fsa@adlas.at>
This commit is contained in:
parent
4cfab4b838
commit
a449bd1a0c
2 changed files with 24 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ class Attachment implements IAttachment {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
* @since 13.0.0
|
||||
*/
|
||||
public function setFilename(string $filename): IAttachment {
|
||||
|
|
@ -53,6 +54,7 @@ class Attachment implements IAttachment {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
* @since 13.0.0
|
||||
*/
|
||||
public function setContentType(string $contentType): IAttachment {
|
||||
|
|
@ -61,6 +63,7 @@ class Attachment implements IAttachment {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
* @since 13.0.0
|
||||
*/
|
||||
public function setBody(string $body): IAttachment {
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class Message implements IMessage {
|
|||
|
||||
/**
|
||||
* @since 13.0.0
|
||||
* @return $this
|
||||
*/
|
||||
public function attach(IAttachment $attachment): IMessage {
|
||||
/** @var Attachment $attachment */
|
||||
|
|
@ -114,6 +115,7 @@ class Message implements IMessage {
|
|||
* If no "From" address is used \OC\Mail\Mailer will use mail_from_address and mail_domain from config.php
|
||||
*
|
||||
* @param array $addresses Example: array('sender@domain.org', 'other@domain.org' => 'A name')
|
||||
* @return $this
|
||||
*/
|
||||
public function setFrom(array $addresses): IMessage {
|
||||
$this->from = $addresses;
|
||||
|
|
@ -129,6 +131,7 @@ class Message implements IMessage {
|
|||
|
||||
/**
|
||||
* Set the Reply-To address of this message
|
||||
* @return $this
|
||||
*/
|
||||
public function setReplyTo(array $addresses): IMessage {
|
||||
$this->replyTo = $addresses;
|
||||
|
|
@ -146,6 +149,7 @@ class Message implements IMessage {
|
|||
* Set the to addresses of this message.
|
||||
*
|
||||
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
|
||||
* @return $this
|
||||
*/
|
||||
public function setTo(array $recipients): IMessage {
|
||||
$this->to = $recipients;
|
||||
|
|
@ -163,6 +167,7 @@ class Message implements IMessage {
|
|||
* Set the CC recipients of this message.
|
||||
*
|
||||
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
|
||||
* @return $this
|
||||
*/
|
||||
public function setCc(array $recipients): IMessage {
|
||||
$this->cc = $recipients;
|
||||
|
|
@ -180,6 +185,7 @@ class Message implements IMessage {
|
|||
* Set the BCC recipients of this message.
|
||||
*
|
||||
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
|
||||
* @return $this
|
||||
*/
|
||||
public function setBcc(array $recipients): IMessage {
|
||||
$this->bcc = $recipients;
|
||||
|
|
@ -193,6 +199,9 @@ class Message implements IMessage {
|
|||
return $this->bcc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubject(string $subject): IMessage {
|
||||
$this->symfonyEmail->subject($subject);
|
||||
return $this;
|
||||
|
|
@ -205,6 +214,9 @@ class Message implements IMessage {
|
|||
return $this->symfonyEmail->getSubject() ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlainBody(string $body): IMessage {
|
||||
$this->symfonyEmail->text($body);
|
||||
return $this;
|
||||
|
|
@ -219,6 +231,9 @@ class Message implements IMessage {
|
|||
return $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setHtmlBody(string $body): IMessage {
|
||||
if (!$this->plainTextOnly) {
|
||||
$this->symfonyEmail->html($body);
|
||||
|
|
@ -240,6 +255,9 @@ class Message implements IMessage {
|
|||
return $this->symfonyEmail;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setBody(string $body, string $contentType): IMessage {
|
||||
if (!$this->plainTextOnly || $contentType !== 'text/html') {
|
||||
if ($contentType === 'text/html') {
|
||||
|
|
@ -277,6 +295,9 @@ class Message implements IMessage {
|
|||
$this->symfonyEmail->bcc(...$this->convertAddresses($this->getBcc()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function useTemplate(IEMailTemplate $emailTemplate): IMessage {
|
||||
$this->setSubject($emailTemplate->renderSubject());
|
||||
$this->setPlainBody($emailTemplate->renderText());
|
||||
|
|
|
|||
Loading…
Reference in a new issue