From 11e8a7165afdce0b54c4b57ffcd9d21aca4d6e6a Mon Sep 17 00:00:00 2001 From: Christian Achatz Date: Fri, 18 May 2018 22:49:52 +0200 Subject: [PATCH] ID#323: introduced type declaration for various classes. --- tools/mail/MailAddress.php | 2 +- tools/mail/Message.php | 2 +- tools/mail/MessageBuilder.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/mail/MailAddress.php b/tools/mail/MailAddress.php index f1283c9b1..2e3e16267 100644 --- a/tools/mail/MailAddress.php +++ b/tools/mail/MailAddress.php @@ -46,7 +46,7 @@ class MailAddress { * * @throws InvalidArgumentException In case of invalid/empty name and/or e-mail. */ - public function __construct($name, $email) { + public function __construct(string $name = null, string $email = null) { if (empty($email)) { throw new InvalidArgumentException('(Display) Name and/or e-mail must not be empty!'); diff --git a/tools/mail/Message.php b/tools/mail/Message.php index 4f8f45713..7ec17e206 100644 --- a/tools/mail/Message.php +++ b/tools/mail/Message.php @@ -81,7 +81,7 @@ class Message { * @param string $subject The message's subject. * @param string $content The message content. */ - public function __construct(MailAddress $sender, $subject, $content) { + public function __construct(MailAddress $sender, string $subject, string $content) { $this->sender = $sender; $this->subject = $subject; diff --git a/tools/mail/MessageBuilder.php b/tools/mail/MessageBuilder.php index f7e942793..7a941f350 100644 --- a/tools/mail/MessageBuilder.php +++ b/tools/mail/MessageBuilder.php @@ -47,7 +47,7 @@ class MessageBuilder extends APFObject { * @version * Version 0.1, 26.01.2017 (ID#251: added builder to allow backward-compatible configuration of e-mail message)
*/ - public function createMessage($section, $subject, $content) { + public function createMessage(string $section, string $subject, string $content) { $config = $this->getConfiguration('APF\tools\mail', 'mailsender.ini');