<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
/**
* {@inheritDoc}
*/
- public function getMessage(bool $plain = false)
+ public function getMessage(bool $plain = false): string
{
if ($plain) {
return $this->msgText;
} else {
- return $this->msgHtml;
+ return $this->msgHtml ?? '';
}
}
$headerString = '';
foreach ($this->additionalMailHeader as $name => $values) {
- if (is_array($values)) {
- foreach ($values as $value) {
- $headerString .= $name . ': ' . $value . '\n';
- }
- } else {
- $headerString .= $name . ': ' . $values . '\n';
+ if (!is_array($values)) {
+ $values = [$values];
+ }
+
+ foreach ($values as $value) {
+ $headerString .= "$name: $value\r\n";
}
}
+
return $headerString;
}
/**
* @inheritDoc
*/
+ #[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->toArray();