Skip to content

Commit c9f83a4

Browse files
committed
[DependencyInjecion] Mention that service definitions replace previous ones
1 parent 8e18cc7 commit c9f83a4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

service_container.rst

+9
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ each time you ask for it.
178178
- '../src/Entity/'
179179
- '../src/Kernel.php'
180180
181+
# order is important in this file because service definitions
182+
# always *replace* previous ones; add your own service configuration below
183+
181184
# ...
182185
183186
.. code-block:: xml
@@ -197,6 +200,9 @@ each time you ask for it.
197200
<!-- this creates a service per class whose id is the fully-qualified class name -->
198201
<prototype namespace="App\" resource="../src/" exclude="../src/{DependencyInjection,Entity,Kernel.php}"/>
199202
203+
<!-- order is important in this file because service definitions
204+
always *replace* previous ones; add your own service configuration below -->
205+
200206
<!-- ... -->
201207
202208
</services>
@@ -219,6 +225,9 @@ each time you ask for it.
219225
// this creates a service per class whose id is the fully-qualified class name
220226
$services->load('App\\', '../src/')
221227
->exclude('../src/{DependencyInjection,Entity,Kernel.php}');
228+
229+
// order is important in this file because service definitions
230+
// always *replace* previous ones; add your own service configuration below
222231
};
223232
224233
.. tip::

0 commit comments

Comments
 (0)