Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit5a88e4c

Browse 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 <!-- seehttps://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/asee#31774 (comment)<!--Replace this notice by a short README for your feature/bugfix. This will help peopleunderstand your PR and can be used as a start for the documentation.Additionally (seehttps://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 parentsf6a6fb6 +d56ae06 commit5a88e4c

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111

1212
namespaceSymfony\Component\Mailer;
1313

14-
useSymfony\Component\Mailer\Exception\InvalidArgumentException;
1514
useSymfony\Component\Mailer\Exception\LogicException;
1615
useSymfony\Component\Mime\Address;
1716
useSymfony\Component\Mime\Header\Headers;
1817
useSymfony\Component\Mime\Message;
19-
useSymfony\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-
publicfunction__construct(RawMessage$message)
32+
publicfunction__construct(Message$message)
3533
{
36-
if (!$messageinstanceof Message) {
37-
// FIXME: parse the raw message to create the envelope?
38-
thrownewInvalidArgumentException(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‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,4 @@ public function testRecipientsFromHeaders()
9191
$e = SmtpEnvelope::create(newMessage($headers));
9292
$this->assertEquals([newAddress('to@symfony.com'),newAddress('cc@symfony.com'),newAddress('bcc@symfony.com')],$e->getRecipients());
9393
}
94-
95-
publicfunctiontestCreateWithRawMessage()
96-
{
97-
$this->expectException(\InvalidArgumentException::class);
98-
SmtpEnvelope::create(newRawMessage(''));
99-
}
10094
}

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

Lines 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-
publicstaticfunctiontoEmail(RawMessage$message):Email
31+
publicstaticfunctiontoEmail(Message$message):Email
3232
{
3333
if ($messageinstanceof Email) {
3434
return$message;
3535
}
3636

37-
if (RawMessage::class ===\get_class($message)) {
38-
// FIXME: parse the raw message to create the envelope?
39-
thrownewRuntimeException(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 ($bodyinstanceof TextPart) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp