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 bf8ecc4

Browse filesBrowse files
committed
feature #42662 [Mailer] Consume a PSR-14 event dispatcher (derrabus)
This PR was merged into the 5.4 branch. Discussion ---------- [Mailer] Consume a PSR-14 event dispatcher | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | TODO This PR proposes to swap our own `EventDispatcherInterface` for the PSR-14 one in mailer. This would allow for a deeper integration of the mailer component into non-Symfony applications that use a different event dispatcher, like https://github.com/thephpleague/event. Note that we still need Symfony's event dispatcher as a dependency, mainly because of `EventSubscriberInterface`. Commits ------- e3c85b2 [Mailer] Consume a PSR-14 event dispatcher
2 parents e3f72bd + e3c85b2 commit bf8ecc4
Copy full SHA for bf8ecc4

39 files changed

+122
-36
lines changed

‎src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Amazon\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Envelope;
1617
use Symfony\Component\Mailer\Exception\HttpTransportException;
1718
use Symfony\Component\Mailer\SentMessage;
1819
use Symfony\Component\Mailer\Transport\AbstractApiTransport;
1920
use Symfony\Component\Mime\Address;
2021
use Symfony\Component\Mime\Email;
21-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2222
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2323
use Symfony\Contracts\HttpClient\HttpClientInterface;
2424
use Symfony\Contracts\HttpClient\ResponseInterface;

‎src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesHttpAsyncAwsTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesHttpAsyncAwsTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
use AsyncAws\Ses\Input\SendEmailRequest;
1616
use AsyncAws\Ses\SesClient;
1717
use AsyncAws\Ses\ValueObject\Destination;
18+
use Psr\EventDispatcher\EventDispatcherInterface;
1819
use Psr\Log\LoggerInterface;
1920
use Symfony\Component\Mailer\Exception\HttpTransportException;
2021
use Symfony\Component\Mailer\SentMessage;
2122
use Symfony\Component\Mailer\Transport\AbstractTransport;
2223
use Symfony\Component\Mime\Message;
23-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2424

2525
/**
2626
* @author Jérémy Derussé <jeremy@derusse.com>

‎src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesHttpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesHttpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Amazon\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Exception\HttpTransportException;
1617
use Symfony\Component\Mailer\SentMessage;
1718
use Symfony\Component\Mailer\Transport\AbstractHttpTransport;
1819
use Symfony\Component\Mime\Message;
19-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2020
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2121
use Symfony\Contracts\HttpClient\HttpClientInterface;
2222
use Symfony\Contracts\HttpClient\ResponseInterface;

‎src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesSmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesSmtpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Amazon\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
16-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1717

1818
/**
1919
* @author Kevin Verschaeve

‎src/Symfony/Component/Mailer/Bridge/Amazon/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Amazon/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"require": {
1919
"php": ">=7.2.5",
2020
"async-aws/ses": "^1.0",
21+
"psr/event-dispatcher": "^1",
2122
"symfony/deprecation-contracts": "^2.1",
2223
"symfony/mailer": "^4.4.21|^5.2.6|^6.0"
2324
},

‎src/Symfony/Component/Mailer/Bridge/Google/Transport/GmailSmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Google/Transport/GmailSmtpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Google\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
16-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1717

1818
/**
1919
* @author Kevin Verschaeve

‎src/Symfony/Component/Mailer/Bridge/Google/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Google/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20+
"psr/event-dispatcher": "^1",
2021
"symfony/mailer": "^4.4|^5.0|^6.0"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Mailchimp\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Envelope;
1617
use Symfony\Component\Mailer\Exception\HttpTransportException;
@@ -19,7 +20,6 @@
1920
use Symfony\Component\Mailer\SentMessage;
2021
use Symfony\Component\Mailer\Transport\AbstractApiTransport;
2122
use Symfony\Component\Mime\Email;
22-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2323
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
2424
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2525
use Symfony\Contracts\HttpClient\HttpClientInterface;

‎src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillHttpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillHttpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Mailchimp\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Exception\HttpTransportException;
1617
use Symfony\Component\Mailer\SentMessage;
1718
use Symfony\Component\Mailer\Transport\AbstractHttpTransport;
1819
use Symfony\Component\Mime\Address;
19-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2020
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
2121
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2222
use Symfony\Contracts\HttpClient\HttpClientInterface;

‎src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillSmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillSmtpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Mailchimp\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
16-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1717

1818
/**
1919
* @author Kevin Verschaeve

‎src/Symfony/Component/Mailer/Bridge/Mailchimp/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailchimp/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20+
"psr/event-dispatcher": "^1",
2021
"symfony/mailer": "^5.1|^6.0"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Mailgun\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Envelope;
1617
use Symfony\Component\Mailer\Exception\HttpTransportException;
@@ -20,7 +21,6 @@
2021
use Symfony\Component\Mailer\Transport\AbstractApiTransport;
2122
use Symfony\Component\Mime\Email;
2223
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
23-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2424
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
2525
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2626
use Symfony\Contracts\HttpClient\HttpClientInterface;

‎src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunHttpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunHttpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Mailgun\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Exception\HttpTransportException;
1617
use Symfony\Component\Mailer\SentMessage;
1718
use Symfony\Component\Mailer\Transport\AbstractHttpTransport;
1819
use Symfony\Component\Mime\Part\DataPart;
1920
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
20-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2121
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
2222
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2323
use Symfony\Contracts\HttpClient\HttpClientInterface;

‎src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunSmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunSmtpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Mailgun\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
16-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1717

1818
/**
1919
* @author Kevin Verschaeve

‎src/Symfony/Component/Mailer/Bridge/Mailgun/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailgun/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20+
"psr/event-dispatcher": "^1",
2021
"symfony/mailer": "^5.2.6|^6.0"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Mailer/Bridge/Mailjet/Transport/MailjetApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailjet/Transport/MailjetApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Mailjet\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Envelope;
1617
use Symfony\Component\Mailer\Exception\HttpTransportException;
@@ -19,7 +20,6 @@
1920
use Symfony\Component\Mailer\Transport\AbstractApiTransport;
2021
use Symfony\Component\Mime\Address;
2122
use Symfony\Component\Mime\Email;
22-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2323
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
2424
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2525
use Symfony\Contracts\HttpClient\HttpClientInterface;

‎src/Symfony/Component/Mailer/Bridge/Mailjet/Transport/MailjetSmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailjet/Transport/MailjetSmtpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Mailjet\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
16-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1717

1818
class MailjetSmtpTransport extends EsmtpTransport
1919
{

‎src/Symfony/Component/Mailer/Bridge/Mailjet/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailjet/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20+
"psr/event-dispatcher": "^1",
2021
"symfony/mailer": "^4.4|^5.0|^6.0"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Mailer/Bridge/Postmark/Transport/PostmarkApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Postmark/Transport/PostmarkApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Postmark\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Envelope;
1617
use Symfony\Component\Mailer\Exception\HttpTransportException;
@@ -19,7 +20,6 @@
1920
use Symfony\Component\Mailer\SentMessage;
2021
use Symfony\Component\Mailer\Transport\AbstractApiTransport;
2122
use Symfony\Component\Mime\Email;
22-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2323
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
2424
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2525
use Symfony\Contracts\HttpClient\HttpClientInterface;

‎src/Symfony/Component/Mailer/Bridge/Postmark/Transport/PostmarkSmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Postmark/Transport/PostmarkSmtpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Postmark\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Envelope;
1617
use Symfony\Component\Mailer\Header\MetadataHeader;
@@ -19,7 +20,6 @@
1920
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
2021
use Symfony\Component\Mime\Message;
2122
use Symfony\Component\Mime\RawMessage;
22-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2323

2424
/**
2525
* @author Kevin Verschaeve

‎src/Symfony/Component/Mailer/Bridge/Postmark/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Postmark/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20+
"psr/event-dispatcher": "^1",
2021
"symfony/mailer": "^5.2.6|^6.0"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Sendgrid\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Envelope;
1617
use Symfony\Component\Mailer\Exception\HttpTransportException;
1718
use Symfony\Component\Mailer\SentMessage;
1819
use Symfony\Component\Mailer\Transport\AbstractApiTransport;
1920
use Symfony\Component\Mime\Address;
2021
use Symfony\Component\Mime\Email;
21-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2222
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
2323
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2424
use Symfony\Contracts\HttpClient\HttpClientInterface;

‎src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridSmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridSmtpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Sendgrid\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
16-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1717

1818
/**
1919
* @author Kevin Verschaeve

‎src/Symfony/Component/Mailer/Bridge/Sendgrid/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20+
"psr/event-dispatcher": "^1",
2021
"symfony/mailer": "^4.4|^5.0|^6.0"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Sendinblue\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Envelope;
1617
use Symfony\Component\Mailer\Exception\HttpTransportException;
@@ -21,7 +22,6 @@
2122
use Symfony\Component\Mime\Address;
2223
use Symfony\Component\Mime\Email;
2324
use Symfony\Component\Mime\Header\Headers;
24-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2525
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
2626
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
2727
use Symfony\Contracts\HttpClient\HttpClientInterface;

‎src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueSmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueSmtpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Sendinblue\Transport;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
16-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1717

1818
/**
1919
* @author Yann LUCAS

‎src/Symfony/Component/Mailer/Bridge/Sendinblue/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendinblue/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20+
"psr/event-dispatcher": "^1",
2021
"symfony/mailer": "^5.1|^6.0"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Mailer/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
5.4
5+
---
6+
7+
* Enable the mailer to operate on any PSR-14-compatible event dispatcher
8+
49
5.3
510
---
611

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Mailer.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
namespace Symfony\Component\Mailer;
1313

14+
use Psr\EventDispatcher\EventDispatcherInterface;
1415
use Symfony\Component\EventDispatcher\Event;
1516
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
1617
use Symfony\Component\Mailer\Event\MessageEvent;
1718
use Symfony\Component\Mailer\Messenger\SendEmailMessage;
1819
use Symfony\Component\Mailer\Transport\TransportInterface;
1920
use Symfony\Component\Messenger\MessageBusInterface;
2021
use Symfony\Component\Mime\RawMessage;
21-
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
22+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as SymfonyEventDispatcherInterface;
2223

2324
/**
2425
* @author Fabien Potencier <fabien@symfony.com>
@@ -33,7 +34,7 @@ public function __construct(TransportInterface $transport, MessageBusInterface $
3334
{
3435
$this->transport = $transport;
3536
$this->bus = $bus;
36-
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
37+
$this->dispatcher = class_exists(Event::class) && $dispatcher instanceof SymfonyEventDispatcherInterface ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
3738
}
3839

3940
public function send(RawMessage $message, Envelope $envelope = null): void

‎src/Symfony/Component/Mailer/Tests/EventListener/MessageListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Tests/EventListener/MessageListenerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Mailer\Tests;
12+
namespace Symfony\Component\Mailer\Tests\EventListener;
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Mailer\Envelope;

0 commit comments

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