Skip to content

Commit cfd2056

Browse files
committed
minor #17385 [DependencyInjection] [DependencyInjecion] Mention that service definitions replace previous ones (javiereguiluz)
This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection] [DependencyInjecion] Mention that service definitions replace previous ones Replaces #16888 to add the warning message in the main article about services config. Commits ------- c9f83a4 [DependencyInjecion] Mention that service definitions replace previous ones
2 parents 8e18cc7 + c9f83a4 commit cfd2056

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)