Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6e63c7

Browse files
committed
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 ------- e7c96d3 Rename the Symfony Mailer service config to avoid conflict with SwitMailer
2 parents a8aad15 + e7c96d3 commit e6e63c7

File tree

1 file changed

+3
-2
lines changed
  • src/Symfony/Bundle/FrameworkBundle/Resources/config

1 file changed

+3
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
66

77
<services>
8-
<service id="mailer" class="Symfony\Component\Mailer\Mailer">
8+
<service id="mailer.mailer" class="Symfony\Component\Mailer\Mailer">
99
<argument type="service" id="mailer.transport" />
1010
<argument type="service" id="messenger.default_bus" on-invalid="ignore" />
1111
</service>
12-
<service id="Symfony\Component\Mailer\MailerInterface" alias="mailer" />
12+
<service id="mailer" alias="mailer.mailer" />
13+
<service id="Symfony\Component\Mailer\MailerInterface" alias="mailer.mailer" />
1314

1415
<service id="mailer.transport" class="Symfony\Component\Mailer\Transport\TransportInterface">
1516
<factory class="Symfony\Component\Mailer\Transport" method="fromDsn" />

0 commit comments

Comments
 (0)