Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a88e4c

Browse filesBrowse files
committed
minor #31837 Change type hints (fabpot)
This PR was merged into the 4.3 branch. Discussion ---------- Change type hints | Q | A | ------------- | --- | Branch? | 4.3 for features / 3.4, 4.2 or 4.3 for bug fixes <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a see #31774 (comment) <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> Commits ------- d56ae06 changed type hints
2 parents f6a6fb6 + d56ae06 commit 5a88e4c
Copy full SHA for 5a88e4c

File tree

3 files changed

+2
-20
lines changed
Filter options

3 files changed

+2
-20
lines changed

‎src/Symfony/Component/Mailer/DelayedSmtpEnvelope.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/DelayedSmtpEnvelope.php
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111

1212
namespace Symfony\Component\Mailer;
1313

14-
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
1514
use Symfony\Component\Mailer\Exception\LogicException;
1615
use Symfony\Component\Mime\Address;
1716
use Symfony\Component\Mime\Header\Headers;
1817
use Symfony\Component\Mime\Message;
19-
use Symfony\Component\Mime\RawMessage;
2018

2119
/**
2220
* @author Fabien Potencier <fabien@symfony.com>
@@ -31,13 +29,8 @@ final class DelayedSmtpEnvelope extends SmtpEnvelope
3129
private $recipientsSet = false;
3230
private $message;
3331

34-
public function __construct(RawMessage $message)
32+
public function __construct(Message $message)
3533
{
36-
if (!$message instanceof Message) {
37-
// FIXME: parse the raw message to create the envelope?
38-
throw new InvalidArgumentException(sprintf('Unable to create an SmtpEnvelope from a "%s" message.', RawMessage::class));
39-
}
40-
4134
$this->message = $message;
4235
}
4336

‎src/Symfony/Component/Mailer/Tests/SmtpEnvelopeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Tests/SmtpEnvelopeTest.php
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,4 @@ public function testRecipientsFromHeaders()
9191
$e = SmtpEnvelope::create(new Message($headers));
9292
$this->assertEquals([new Address('to@symfony.com'), new Address('cc@symfony.com'), new Address('bcc@symfony.com')], $e->getRecipients());
9393
}
94-
95-
public function testCreateWithRawMessage()
96-
{
97-
$this->expectException(\InvalidArgumentException::class);
98-
SmtpEnvelope::create(new RawMessage(''));
99-
}
10094
}

‎src/Symfony/Component/Mime/MessageConverter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/MessageConverter.php
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,12 @@ final class MessageConverter
2828
/**
2929
* @throws RuntimeException when unable to convert the message to an email
3030
*/
31-
public static function toEmail(RawMessage $message): Email
31+
public static function toEmail(Message $message): Email
3232
{
3333
if ($message instanceof Email) {
3434
return $message;
3535
}
3636

37-
if (RawMessage::class === \get_class($message)) {
38-
// FIXME: parse the raw message to create the envelope?
39-
throw new RuntimeException(sprintf('Unable to create an Email from an instance of "%s" as it is not supported yet.', RawMessage::class));
40-
}
41-
4237
// try to convert to a "simple" Email instance
4338
$body = $message->getBody();
4439
if ($body instanceof TextPart) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.