diff --git a/components/dependency_injection.rst b/components/dependency_injection.rst index ef2c449e23f..4cdfcd3ea90 100644 --- a/components/dependency_injection.rst +++ b/components/dependency_injection.rst @@ -299,7 +299,8 @@ config files: $services = $configurator->services(); $services->set('mailer', 'Mailer') - ->args(['%mailer.transport%']) + // the param() method was introduced in Symfony 5.2. + ->args([param('mailer.transport')]) ; $services->set('newsletter_manager', 'NewsletterManager') diff --git a/service_container.rst b/service_container.rst index bbbab8a6933..57440ccc724 100644 --- a/service_container.rst +++ b/service_container.rst @@ -1116,7 +1116,7 @@ admin email. In this case, each needs to have a unique service id: ->args([ service(MessageGenerator::class), service('mailer'), - 'superadmin@example.com', + 'superadmin@example.com', ]); $services->set('site_update_manager.normal_users', SiteUpdateManager::class) diff --git a/service_container/tags.rst b/service_container/tags.rst index ff56d90c73f..2819c1bd267 100644 --- a/service_container/tags.rst +++ b/service_container/tags.rst @@ -273,7 +273,8 @@ For example, you may add the following transports as services: $services = $configurator->services(); $services->set(\Swift_SmtpTransport::class) - ->args(['%mailer_host%']) + // the param() method was introduced in Symfony 5.2. + ->args([param('mailer_host')]) ->tag('app.mail_transport') ; @@ -437,7 +438,8 @@ To answer this, change the service declaration: $services = $configurator->services(); $services->set(\Swift_SmtpTransport::class) - ->args(['%mailer_host%']) + // the param() method was introduced in Symfony 5.2. + ->args([param('mailer_host')]) ->tag('app.mail_transport', ['alias' => 'smtp']) ;