Update dependencies

This commit is contained in:
Kode
2022-06-29 13:20:08 +01:00
parent bbae811cd8
commit e2ba89c80e
349 changed files with 21017 additions and 4079 deletions

View File

@@ -272,12 +272,16 @@ class Email extends Message
}
/**
* @param resource|string $body
* @param resource|string|null $body
*
* @return $this
*/
public function text($body, string $charset = 'utf-8')
{
if (null !== $body && !\is_string($body) && !\is_resource($body)) {
throw new \TypeError(sprintf('The body must be a string, a resource or null (got "%s").', get_debug_type($body)));
}
$this->text = $body;
$this->textCharset = $charset;
@@ -304,6 +308,10 @@ class Email extends Message
*/
public function html($body, string $charset = 'utf-8')
{
if (null !== $body && !\is_string($body) && !\is_resource($body)) {
throw new \TypeError(sprintf('The body must be a string, a resource or null (got "%s").', get_debug_type($body)));
}
$this->html = $body;
$this->htmlCharset = $charset;
@@ -330,6 +338,10 @@ class Email extends Message
*/
public function attach($body, string $name = null, string $contentType = null)
{
if (!\is_string($body) && !\is_resource($body)) {
throw new \TypeError(sprintf('The body must be a string or a resource (got "%s").', get_debug_type($body)));
}
$this->attachments[] = ['body' => $body, 'name' => $name, 'content-type' => $contentType, 'inline' => false];
return $this;
@@ -352,6 +364,10 @@ class Email extends Message
*/
public function embed($body, string $name = null, string $contentType = null)
{
if (!\is_string($body) && !\is_resource($body)) {
throw new \TypeError(sprintf('The body must be a string or a resource (got "%s").', get_debug_type($body)));
}
$this->attachments[] = ['body' => $body, 'name' => $name, 'content-type' => $contentType, 'inline' => true];
return $this;
@@ -463,7 +479,7 @@ class Email extends Message
$names = [];
$htmlPart = null;
$html = $this->html;
if (null !== $this->html) {
if (null !== $html) {
$htmlPart = new TextPart($html, $this->htmlCharset, 'html');
$html = $htmlPart->getBody();
preg_match_all('(<img\s+[^>]*src\s*=\s*(?:([\'"])cid:([^"]+)\\1|cid:([^>\s]+)))i', $html, $names);