bug #31854 Rename the Symfony Mailer service implementation to avoid conflict with SwitMailer (tgalopin)

This PR was merged into the 4.3 branch.

Discussion
----------

Rename the Symfony Mailer service implementation to avoid conflict with SwitMailer

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

When you install Symfony Mailer as well as SwitMailer and try to typehint MailerInterface, the autowiring alias is aliased to the "mailer" service which is overriden by SwitMailer, thus making the injection fail.

Commits
-------

e7c96d3b43 Rename the Symfony Mailer service config to avoid conflict with SwitMailer
This commit is contained in:
Fabien Potencier 2019-06-05 04:04:45 +02:00
commit e6e63c7d32
1 changed files with 3 additions and 2 deletions

View File

@ -5,11 +5,12 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="mailer" class="Symfony\Component\Mailer\Mailer">
<service id="mailer.mailer" class="Symfony\Component\Mailer\Mailer">
<argument type="service" id="mailer.transport" />
<argument type="service" id="messenger.default_bus" on-invalid="ignore" />
</service>
<service id="Symfony\Component\Mailer\MailerInterface" alias="mailer" />
<service id="mailer" alias="mailer.mailer" />
<service id="Symfony\Component\Mailer\MailerInterface" alias="mailer.mailer" />
<service id="mailer.transport" class="Symfony\Component\Mailer\Transport\TransportInterface">
<factory class="Symfony\Component\Mailer\Transport" method="fromDsn" />