@@ -242,7 +242,7 @@ a parent for a service.
242
242
use Symfony\Component\DependencyInjection\Reference;
243
243
244
244
// ...
245
-
245
+
246
246
$mailManager = new Definition();
247
247
$mailManager
248
248
->setAbstract(true);
@@ -254,11 +254,11 @@ a parent for a service.
254
254
))
255
255
;
256
256
$container->setDefinition('mail_manager', $mailManager);
257
-
257
+
258
258
$newsletterManager = new DefinitionDecorator('mail_manager');
259
259
$newsletterManager->setClass('%newsletter_manager.class%');
260
260
$container->setDefinition('newsletter_manager', $newsletterManager);
261
-
261
+
262
262
$greetingCardManager = new DefinitionDecorator('mail_manager');
263
263
$greetingCardManager->setClass('%greeting_card_manager.class%');
264
264
$container->setDefinition('greeting_card_manager', $greetingCardManager);
@@ -291,13 +291,13 @@ would cause an exception to be raised for a non-abstract service.
291
291
In order for parent dependencies to resolve, the ``ContainerBuilder `` must
292
292
first be compiled. See :doc: `/components/dependency_injection/compilation `
293
293
for more details.
294
-
294
+
295
295
.. tip ::
296
296
297
- In the examples shown, the classes sharing the same configuration also extend
298
- from the same parent in PHP. This does not need to be the case though, you can
299
- extract common parts of similar service definitions into a parent service without
300
- also extending a parent class in PHP.
297
+ In the examples shown, the classes sharing the same configuration also
298
+ extend from the same parent class in PHP. This isn't necessary at all.
299
+ You can just extract common parts of similar service definitions into
300
+ a parent service without also extending a parent class in PHP.
301
301
302
302
Overriding Parent Dependencies
303
303
------------------------------
@@ -377,7 +377,7 @@ to the ``NewsletterManager`` class, the config would look like this:
377
377
378
378
// ...
379
379
$container->setDefinition('my_alternative_mailer', ...);
380
-
380
+
381
381
$mailManager = new Definition();
382
382
$mailManager
383
383
->setAbstract(true);
0 commit comments