@@ -34,6 +34,7 @@ public function process(ContainerBuilder $container)
34
34
}
35
35
$ definitions ->insert (array ($ id , $ definition ), array ($ decorated [2 ], --$ order ));
36
36
}
37
+ $ decoratingDefinitions = array ();
37
38
38
39
foreach ($ definitions as list ($ id , $ definition )) {
39
40
list ($ inner , $ renamedId ) = $ definition ->getDecoratedService ();
@@ -54,12 +55,18 @@ public function process(ContainerBuilder $container)
54
55
$ container ->setAlias ($ renamedId , new Alias ((string ) $ alias , false ));
55
56
} else {
56
57
$ decoratedDefinition = $ container ->getDefinition ($ inner );
57
- $ definition ->setTags (array_merge ($ decoratedDefinition ->getTags (), $ definition ->getTags ()));
58
58
$ public = $ decoratedDefinition ->isPublic ();
59
59
$ private = $ decoratedDefinition ->isPrivate ();
60
60
$ decoratedDefinition ->setPublic (false );
61
- $ decoratedDefinition ->setTags (array ());
62
61
$ container ->setDefinition ($ renamedId , $ decoratedDefinition );
62
+ $ decoratingDefinitions [$ inner ] = $ decoratedDefinition ;
63
+ }
64
+
65
+ if (isset ($ decoratingDefinitions [$ inner ])) {
66
+ $ decoratingDefinition = $ decoratingDefinitions [$ inner ];
67
+ $ definition ->setTags (array_merge ($ decoratingDefinition ->getTags (), $ definition ->getTags ()));
68
+ $ decoratingDefinition ->setTags (array ());
69
+ $ decoratingDefinitions [$ inner ] = $ definition ;
63
70
}
64
71
65
72
$ container ->setAlias ($ inner , $ id )->setPublic ($ public )->setPrivate ($ private );
0 commit comments