@@ -5,7 +5,7 @@ How to Decorating Services
5
5
==========================
6
6
7
7
When overriding an existing definition (e.g. when applying the `Decorator pattern `_),
8
- the old service is lost:
8
+ the original service is lost:
9
9
10
10
.. configuration-block ::
11
11
@@ -15,8 +15,8 @@ the old service is lost:
15
15
app.mailer :
16
16
class : AppBundle\Mailer
17
17
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
20
20
app.mailer :
21
21
class AppBundle\DecoratingMailer
22
22
@@ -31,8 +31,8 @@ the old service is lost:
31
31
32
32
<service id =" app.mailer" class =" AppBundle\Mailer" />
33
33
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 -->
36
36
<service id =" app.mailer" class =" AppBundle\DecoratingMailer" />
37
37
38
38
</service >
@@ -42,8 +42,8 @@ the old service is lost:
42
42
43
43
$container->register('mailer', 'AppBundle\Mailer');
44
44
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
47
47
$container->register('mailer', 'AppBundle\DecoratingMailer');
48
48
49
49
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``:
97
97
->setPublic(false)
98
98
;
99
99
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
102
102
convention, the old ``app.mailer `` service is renamed to
103
103
``app.decorating_mailer.inner ``, so you can inject it into your new service.
104
104
0 commit comments