@@ -5,7 +5,7 @@ How to Decorating Services
55==========================
66
77When overriding an existing definition (e.g. when applying the `Decorator pattern `_),
8- the old service is lost:
8+ the original service is lost:
99
1010.. configuration-block ::
1111
@@ -15,8 +15,8 @@ the old service is lost:
1515 app.mailer :
1616 class : AppBundle\Mailer
1717
18- # this is going to replace the old app.mailer definition with the
19- # new one, the old definition is lost
18+ # this replaces the old app.mailer definition with the new one, the
19+ # old definition is lost
2020 app.mailer :
2121 class AppBundle\DecoratingMailer
2222
@@ -31,8 +31,8 @@ the old service is lost:
3131
3232 <service id =" app.mailer" class =" AppBundle\Mailer" />
3333
34- <!-- this is going to replace the old app.mailer definition
35- with the new one, the old definition is lost -->
34+ <!-- this replaces the old app.mailer definition with the new
35+ one, the old definition is lost -->
3636 <service id =" app.mailer" class =" AppBundle\DecoratingMailer" />
3737
3838 </service >
@@ -42,8 +42,8 @@ the old service is lost:
4242
4343 $container->register('mailer', 'AppBundle\Mailer');
4444
45- // this is going to replace the old app.mailer definition with the new
46- // one, the old definition is lost
45+ // this replaces the old app.mailer definition with the new one, the
46+ // old definition is lost
4747 $container->register('mailer', 'AppBundle\DecoratingMailer');
4848
4949 Most of the time, that's exactly what you want to do. But sometimes,
@@ -97,8 +97,8 @@ a reference of the old one as ``app.decorating_mailer.inner``:
9797 ->setPublic(false)
9898 ;
9999
100- Here is what's going on here: the decorates option tells the container that the
101- ``app.decorating_mailer `` service should replace the ``app.mailer `` service. By
100+ Here is what's going on here: the `` decorates `` option tells the container that
101+ the ``app.decorating_mailer `` service replaces the ``app.mailer `` service. By
102102convention, the old ``app.mailer `` service is renamed to
103103``app.decorating_mailer.inner ``, so you can inject it into your new service.
104104
0 commit comments