diff --git a/UPGRADE-7.0.md b/UPGRADE-7.0.md index 4c294b66bffc8..704bd1cff0137 100644 --- a/UPGRADE-7.0.md +++ b/UPGRADE-7.0.md @@ -83,6 +83,12 @@ Messenger * Add parameter `$isSameDatabase` to `DoctrineTransport::configureSchema()` +Mime +---- + + * Remove `Email::attachPart()` method, use `Email::addPart()` instead + * Parameter `$body` is now required (at least null) in `Message::setBody()` + PropertyAccess -------------- diff --git a/src/Symfony/Component/Mime/CHANGELOG.md b/src/Symfony/Component/Mime/CHANGELOG.md index 41eb14a4ec1cf..810018ba32327 100644 --- a/src/Symfony/Component/Mime/CHANGELOG.md +++ b/src/Symfony/Component/Mime/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +7.0 +--- + + * Remove `Email::attachPart()`, use `Email::addPart()` instead + * Argument `$body` is now required (at least null) in `Message::setBody()` + 6.3 --- diff --git a/src/Symfony/Component/Mime/Email.php b/src/Symfony/Component/Mime/Email.php index 7f3496d1fcb6a..67eea6c87713a 100644 --- a/src/Symfony/Component/Mime/Email.php +++ b/src/Symfony/Component/Mime/Email.php @@ -356,18 +356,6 @@ public function embedFromPath(string $path, string $name = null, string $content return $this->addPart((new DataPart(new File($path), $name, $contentType))->asInline()); } - /** - * @return $this - * - * @deprecated since Symfony 6.2, use addPart() instead - */ - public function attachPart(DataPart $part): static - { - @trigger_deprecation('symfony/mime', '6.2', 'The "%s()" method is deprecated, use "addPart()" instead.', __METHOD__); - - return $this->addPart($part); - } - /** * @return $this */ diff --git a/src/Symfony/Component/Mime/Message.php b/src/Symfony/Component/Mime/Message.php index e636c2e8e5546..6b78316606d6c 100644 --- a/src/Symfony/Component/Mime/Message.php +++ b/src/Symfony/Component/Mime/Message.php @@ -42,11 +42,8 @@ public function __clone() /** * @return $this */ - public function setBody(AbstractPart $body = null): static + public function setBody(?AbstractPart $body): static { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/mime', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } $this->body = $body; return $this;
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: