From 11f0fa5033e1d8dfaeb17c8cbc80ef846e9fe59a Mon Sep 17 00:00:00 2001 From: Arikaim Date: Sun, 24 Dec 2023 16:02:12 +0200 Subject: [PATCH] = --- Interfaces/MailInterface.php | 4 ++-- Mail.php | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Interfaces/MailInterface.php b/Interfaces/MailInterface.php index 9c9abbb..01a20fb 100644 --- a/Interfaces/MailInterface.php +++ b/Interfaces/MailInterface.php @@ -19,7 +19,7 @@ interface MailInterface * * @return MailInterface */ - public function build(); + public function build(): object; /** * Get Email message instance @@ -40,5 +40,5 @@ public function getFrom(); * @param string|null $name * @return Self */ - public function from($email, ?string $name = null); + public function from($email, ?string $name = null): object; } diff --git a/Mail.php b/Mail.php index 0a6f4da..67f1a11 100644 --- a/Mail.php +++ b/Mail.php @@ -82,7 +82,7 @@ public function getErros(): array */ public function hasError(): bool { - return (count($this->errros) > 0); + return (count($this->errors) > 0); } /** @@ -91,7 +91,7 @@ public function hasError(): bool * @param MailerInterface $mailer * @return Self */ - public static function create(MailerInterface $mailer) + public static function create(MailerInterface $mailer): object { return new Self($mailer); } @@ -101,7 +101,7 @@ public static function create(MailerInterface $mailer) * * @return Self */ - public function build() + public function build(): object { return $this; } @@ -112,7 +112,7 @@ public function build() * @param string $subject * @return Self */ - public function subject(string $subject) + public function subject(string $subject): object { $this->message->subject($subject); @@ -127,7 +127,7 @@ public function subject(string $subject) * @param string $contentType * @return Self */ - public function attach(string $path, string $name = null, string $contentType = null) + public function attach(string $path, string $name = null, string $contentType = null): object { $this->message->attachFromPath($path,$name,$contentType); @@ -141,7 +141,7 @@ public function attach(string $path, string $name = null, string $contentType = * @param string|null $name * @return Self */ - public function from($email, ?string $name = null) + public function from($email, ?string $name = null): object { try { $email = \trim($email ?? ''); @@ -169,7 +169,7 @@ public function getFrom() * @param string|null $name * @return Self */ - public function to($email, ?string $name = null) + public function to($email, ?string $name = null): object { try { $email = \trim($email ?? ''); @@ -190,7 +190,7 @@ public function to($email, ?string $name = null) * @param string|null $name * @return Self */ - public function replyTo($email, ?string $name = null) + public function replyTo($email, ?string $name = null): object { try { $email = \trim($email ?? ''); @@ -210,7 +210,7 @@ public function replyTo($email, ?string $name = null) * @param string|null $name * @return Self */ - public function cc($email, ?string $name = null) + public function cc($email, ?string $name = null): object { try { $email = \trim($email ?? ''); @@ -230,7 +230,7 @@ public function cc($email, ?string $name = null) * @param string|null $name * @return Self */ - public function bcc($email, ?string $name = null) + public function bcc($email, ?string $name = null): object { try { $email = \trim($email ?? ''); @@ -249,7 +249,7 @@ public function bcc($email, ?string $name = null) * @param integer $priority * @return Self */ - public function priority(int $priority = 3) + public function priority(int $priority = 3): object { $this->message->priority($priority); @@ -262,7 +262,7 @@ public function priority(int $priority = 3) * @param string $message * @return Self */ - public function message(string $message, ?string $contentType = null) + public function message(string $message, ?string $contentType = null): object { if (empty($contentType) == true) { // detect @@ -284,7 +284,7 @@ public function message(string $message, ?string $contentType = null) * @param string $type * @return Self */ - public function contentType(string $type = Self::PLAIN_CONTENT_TYPE) + public function contentType(string $type = Self::PLAIN_CONTENT_TYPE): object { $this->contentType = $type;