File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/Symfony/Component/Cache
Tests/DependencyInjection Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,11 @@ public function process(ContainerBuilder $container)
58
58
continue ;
59
59
}
60
60
$ class = $ adapter ->getClass ();
61
+ $ providers = $ adapter ->getArguments ();
61
62
while ($ adapter instanceof ChildDefinition) {
62
63
$ adapter = $ container ->findDefinition ($ adapter ->getParent ());
63
64
$ class = $ class ?: $ adapter ->getClass ();
65
+ $ providers += $ adapter ->getArguments ();
64
66
if ($ t = $ adapter ->getTag ('cache.pool ' )) {
65
67
$ tags [0 ] += $ t [0 ];
66
68
}
@@ -90,7 +92,7 @@ public function process(ContainerBuilder $container)
90
92
91
93
if (ChainAdapter::class === $ class ) {
92
94
$ adapters = [];
93
- foreach ($ adapter -> getArgument ( 0 ) as $ provider => $ adapter ) {
95
+ foreach ($ providers [ ' index_0 ' ] ?? $ providers [ 0 ] as $ provider => $ adapter ) {
94
96
if ($ adapter instanceof ChildDefinition) {
95
97
$ chainedPool = $ adapter ;
96
98
} else {
Original file line number Diff line number Diff line change @@ -209,7 +209,8 @@ public function testChainAdapterPool()
209
209
$ container ->register ('cache.adapter.apcu ' , ApcuAdapter::class)
210
210
->setArguments ([null , 0 , null ])
211
211
->addTag ('cache.pool ' );
212
- $ container ->register ('cache.chain ' , ChainAdapter::class)
212
+ $ container ->register ('cache.adapter.chain ' , ChainAdapter::class);
213
+ $ container ->setDefinition ('cache.chain ' , new ChildDefinition ('cache.adapter.chain ' ))
213
214
->addArgument (['cache.adapter.array ' , 'cache.adapter.apcu ' ])
214
215
->addTag ('cache.pool ' );
215
216
$ container ->setDefinition ('cache.app ' , new ChildDefinition ('cache.chain ' ))
@@ -224,7 +225,7 @@ public function testChainAdapterPool()
224
225
$ this ->assertSame ('cache.chain ' , $ appCachePool ->getParent ());
225
226
226
227
$ chainCachePool = $ container ->getDefinition ('cache.chain ' );
227
- $ this ->assertNotInstanceOf (ChildDefinition::class, $ chainCachePool );
228
+ $ this ->assertInstanceOf (ChildDefinition::class, $ chainCachePool );
228
229
$ this ->assertCount (2 , $ chainCachePool ->getArgument (0 ));
229
230
$ this ->assertInstanceOf (ChildDefinition::class, $ chainCachePool ->getArgument (0 )[0 ]);
230
231
$ this ->assertSame ('cache.adapter.array ' , $ chainCachePool ->getArgument (0 )[0 ]->getParent ());
You can’t perform that action at this time.
0 commit comments