Skip to content

Commit 4ef1a71

Browse files
yanickjweaverryan
yanickj
authored andcommitted
Synchronized setter injection occurs on Container::set() not on Container::enterScope()
1 parent 7c1b2c3 commit 4ef1a71

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cookbook/service_container/scopes.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ marked as ``synchronized``:
134134
class: Acme\HelloBundle\Client\ClientConfiguration
135135
scope: client
136136
synchronized: true
137+
synthetic: true
137138
# ...
138139
139140
.. code-block:: xml
@@ -151,6 +152,7 @@ marked as ``synchronized``:
151152
id="client_configuration"
152153
scope="client"
153154
synchronized="true"
155+
synthetic="true"
154156
class="Acme\HelloBundle\Client\ClientConfiguration"
155157
/>
156158
</services>
@@ -196,9 +198,9 @@ and everything works without any special code in your service or in your definit
196198
}
197199
}
198200

199-
Whenever the ``client`` scope is entered or left, the service container will
200-
automatically call the ``setClientConfiguration()`` method with the current
201-
``client_configuration`` instance.
201+
Whenever the ``client`` scope is active, the service container will
202+
automatically call the ``setClientConfiguration()`` method when the
203+
``client_configuration`` service is set in the container.
202204

203205
You might have noticed that the ``setClientConfiguration()`` method accepts
204206
``null`` as a valid value for the ``client_configuration`` argument. That's

0 commit comments

Comments
 (0)