diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index 8167cbc2c1964a79b4fea03c6e07259ca556e93f..dc5974dcf55c3aa772812c3b5663c763e42af473 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -1825,16 +1825,6 @@ parameters: count: 1 path: ../../typo3/sysext/core/Classes/Utility/IpAnonymizationUtility.php - - - message: "#^Method TYPO3\\\\CMS\\\\Core\\\\Utility\\\\MailUtility\\:\\:getSystemFrom\\(\\) should return array but returns null\\.$#" - count: 1 - path: ../../typo3/sysext/core/Classes/Utility/MailUtility.php - - - - message: "#^Method TYPO3\\\\CMS\\\\Core\\\\Utility\\\\MailUtility\\:\\:getSystemFromName\\(\\) should return string but returns null\\.$#" - count: 1 - path: ../../typo3/sysext/core/Classes/Utility/MailUtility.php - - message: "#^Method TYPO3\\\\CMS\\\\Core\\\\Utility\\\\MathUtility\\:\\:calculateWithParentheses\\(\\) should return int but returns string\\.$#" count: 2 diff --git a/typo3/sysext/core/Classes/Utility/MailUtility.php b/typo3/sysext/core/Classes/Utility/MailUtility.php index 4437546a64e8b328f29e6cdf5f7d9c5e74e4190b..57bdf1dadd3fba387f97d107f0dd68dcd3892d86 100644 --- a/typo3/sysext/core/Classes/Utility/MailUtility.php +++ b/typo3/sysext/core/Classes/Utility/MailUtility.php @@ -27,7 +27,12 @@ class MailUtility * * Ready to be passed to $mail->setFrom() * - * @return array key=Valid email address which can be used as sender, value=Valid name which can be used as a sender. NULL if no address is configured + * This method can return three different variants: + * 1. An assoc. array: key => Valid email address which can be used as sender; value => Valid name which can be used as a sender + * 2. A numeric array with one entry: Valid email address which can be used as sender + * 3. Null, if no address is configured + * + * @return array<string|int, string>|null */ public static function getSystemFrom() { @@ -47,7 +52,7 @@ class MailUtility * * As configured in Install Tool. * - * @return string The name (unquoted, unformatted). NULL if none is set + * @return string|null The name (unquoted, unformatted). NULL if none is set or an invalid non-string value. */ public static function getSystemFromName() { @@ -90,7 +95,13 @@ class MailUtility * * Ready to be passed to $mail->setReplyTo() * - * @return array List of email-addresses. Specifying a realname can be done in the form of "replyToName <replyTo@example.com>". + * This method returns a list of email addresses, but depending on the existence of "defaultMailReplyToName" + * the array can have a different shape: + * + * 1. An assoc. array: key => a valid reply-to address which can be used as sender; value => a valid reply-to name which can be used as a sender + * 2. A numeric array with one entry: a valid reply-to address which can be used as sender + * + * @return array<string|int, string> */ public static function getSystemReplyTo(): array {