Skip to content

Migrate Yaml config for DI calls to new syntax #14168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dependency_injection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ config files:
newsletter_manager:
class: NewsletterManager
calls:
- [setMailer, ['@mailer']]
- setMailer: ['@mailer']

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion service_container/calls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ To configure the container to call the ``setLogger`` method, use the ``calls`` k
App\Service\MessageGenerator:
# ...
calls:
- [setLogger, ['@logger']]
- setLogger: ['@logger']

.. code-block:: xml

Expand Down
4 changes: 2 additions & 2 deletions service_container/injection_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ In order to use this type of injection, don't forget to configure it:
app.newsletter_manager:
class: App\Mail\NewsletterManager
calls:
- [withMailer, ['@mailer'], true]
- withMailer: !returns_clone ['@mailer']

.. code-block:: xml

Expand Down Expand Up @@ -244,7 +244,7 @@ that accepts the dependency::
app.newsletter_manager:
class: App\Mail\NewsletterManager
calls:
- [setMailer, ['@mailer']]
- setMailer: ['@mailer']

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion service_container/optional_dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ call if the service exists and remove the method call if it does not:
services:
App\Newsletter\NewsletterManager:
calls:
- [setLogger, ['@?logger']]
- setLogger: ['@?logger']

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion service_container/parent_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ duplicated service definitions:
abstract: true
arguments: ['@doctrine.orm.entity_manager']
calls:
- [setLogger, ['@logger']]
- setLogger: ['@logger']

App\Repository\DoctrineUserRepository:
# extend the App\Repository\BaseDoctrineRepository service
Expand Down
12 changes: 5 additions & 7 deletions session/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ First, define a Symfony service for the connection to the Redis server:
# you can also use \RedisArray, \RedisCluster or \Predis\Client classes
class: Redis
calls:
- method: connect
arguments:
- '%env(REDIS_HOST)%'
- '%env(int:REDIS_PORT)%'
- connect:
- '%env(REDIS_HOST)%'
- '%env(int:REDIS_PORT)%'

# uncomment the following if your Redis server requires a password
# - method: auth
# arguments:
# - '%env(REDIS_PASSWORD)%'
# - auth:
# - '%env(REDIS_PASSWORD)%'

.. code-block:: xml

Expand Down