Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Inject services instead of autowire
Browse files Browse the repository at this point in the history
  • Loading branch information
ts-navghane committed Jul 24, 2023
1 parent 85fdfe5 commit 29bda56
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use MauticPlugin\SparkpostBundle\Mailer\Factory\SparkpostTransportFactory;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return function (ContainerConfigurator $configurator) {
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

return static function (ContainerConfigurator $configurator) {
$services = $configurator->services()
->defaults()
->autowire()
Expand All @@ -19,8 +21,13 @@
];

$services->set('mailer.transport_factory.sparkpost', SparkpostTransportFactory::class)
->tag('mailer.transport_factory')
->autowire();
->args([
service('mautic.email.model.transport_callback'),
service('event_dispatcher'),
service('http_client'),
service('logger'),
])
->tag('mailer.transport_factory');

$services->load('MauticPlugin\\SparkpostBundle\\', '../')
->exclude('../{'.implode(',', array_merge(MauticCoreExtension::DEFAULT_EXCLUDES, $excludes)).'}');
Expand Down

0 comments on commit 29bda56

Please sign in to comment.