Upgrade to 4.0.0

This commit is contained in:
Bastian Allgeier
2023-11-28 09:33:56 +01:00
parent f96b96af76
commit 3b0b6546ca
480 changed files with 21371 additions and 13327 deletions

View File

@@ -17,17 +17,29 @@ use Kirby\Toolkit\Properties;
*/
class Body
{
use Properties;
protected string|null $html = null;
protected string|null $text = null;
protected string|null $html;
protected string|null $text;
/**
* Email body constructor
*/
public function __construct(array $props = [])
{
$this->setProperties($props);
$this->html = $props['html'] ?? null;
$this->text = $props['text'] ?? null;
}
/**
* Creates a new instance while
* merging initial and new properties
* @deprecated 4.0.0
*/
public function clone(array $props = []): static
{
return new static(array_merge_recursive([
'html' => $this->html,
'text' => $this->text
], $props));
}
/**
@@ -47,24 +59,13 @@ class Body
}
/**
* Sets the HTML content for the email body
*
* @return $this
* @since 4.0.0
*/
protected function setHtml(string|null $html = null): static
public function toArray(): array
{
$this->html = $html;
return $this;
}
/**
* Sets the plain text content for the email body
*
* @return $this
*/
protected function setText(string|null $text = null): static
{
$this->text = $text;
return $this;
return [
'html' => $this->html(),
'text' => $this->text()
];
}
}