From: Tim Düsterhus Date: Fri, 12 May 2023 07:42:54 +0000 (+0200) Subject: Add proper types to Mailbox X-Git-Tag: 6.0.0_Alpha_1~108^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=24929676f4f13050612091d247e20f535060b0c5;p=GitHub%2FWoltLab%2FWCF.git Add proper types to Mailbox --- diff --git a/wcfsetup/install/files/lib/system/email/Mailbox.class.php b/wcfsetup/install/files/lib/system/email/Mailbox.class.php index 4f8b67b7d5..4782626e6a 100644 --- a/wcfsetup/install/files/lib/system/email/Mailbox.class.php +++ b/wcfsetup/install/files/lib/system/email/Mailbox.class.php @@ -19,31 +19,28 @@ class Mailbox { /** * The email address of this mailbox. - * @var string */ - protected $address; + protected string $address; /** * The human readable name of this mailbox. - * @var string */ - protected $name; + protected ?string $name; /** * The preferred language of this mailbox. - * @var int */ - protected $languageID; + protected int $languageID; /** * Creates a new Mailbox. * - * @param string $address email address of this mailbox - * @param string $name human readable name of this mailbox (or null) - * @param Language $language Language to use for localization (or null for the default language) - * @throws \DomainException + * @param $address email address of this mailbox + * @param $name human readable name of this mailbox (or null) + * @param $language Language to use for localization (or null for the default language) + * @throws \DomainException */ - public function __construct($address, $name = null, ?Language $language = null) + public function __construct(string $address, ?string $name = null, ?Language $language = null) { $this->address = self::filterAddress($address); $this->name = $name; @@ -106,20 +103,16 @@ class Mailbox /** * Returns the human readable name of this mailbox. - * - * @return string */ - public function getName() + public function getName(): ?string { return $this->name; } /** * Returns the email address of this mailbox. - * - * @return string */ - public function getAddress() + public function getAddress(): string { return $this->address; } @@ -127,10 +120,8 @@ class Mailbox /** * Returns the language the recipient of this mailbox wants. * This is used for localization of the email template. - * - * @return Language */ - public function getLanguage() + public function getLanguage(): Language { return LanguageFactory::getInstance()->getLanguage($this->languageID); }