8000 Merge branch '7.2' into 7.3 · symfony/cache@a7c6caa · GitHub
[go: up one dir, main page]

Skip to content

Commit a7c6caa

Browse files
Merge branch '7.2' into 7.3
* 7.2: - [Console] Table counts wrong column width when using colspan and `setColumnMaxWidth()` [Console] Table counts wrong number of padding symbols in `renderCell()` method when cell contain unicode variant selector [Cache] Fix using a `ChainAdapter` as an adapter for a pool [Serializer] Fix collect_denormalization_errors flag in defaultContext [TypeInfo] Fix handling `ConstFetchNode` [VarDumper] Avoid deprecated call in PgSqlCaster Fix command option mode (InputOption::VALUE_REQUIRED) use an EOL-agnostic approach to parse class uses [Uid] Improve entropy of the increment for UUIDv7 [HttpKernel] Fix `#[MapUploadedFile]` handling for optional file uploads
2 parents f42f711 + 7bc97a8 commit a7c6caa

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

DependencyInjection/CachePoolPass.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ public function process(ContainerBuilder $container): void
5555
continue;
5656
}
5757
$class = $adapter->getClass();
58+
$providers = $adapter->getArguments();
5859
while ($adapter instanceof ChildDefinition) {
5960
$adapter = $container->findDefinition($adapter->getParent());
6061
$class = $class ?: $adapter->getClass();
62+
$providers += $adapter->getArguments();
6163
if ($t = $adapter->getTag('cache.pool')) {
6264
$tags[0] += $t[0];
6365
}
@@ -87,7 +89,7 @@ public function process(ContainerBuilder $container): void
8789

8890
if (ChainAdapter::class === $class) {
8991
$adapters = [];
90-
foreach ($adapter->getArgument(0) as $provider => $adapter) {
92+
foreach ($providers['index_0'] ?? $providers[0] as $provider => $adapter) {
9193
if ($adapter instanceof ChildDefinition) {
9294
$chainedPool = $adapter;
9395
} else {

Tests/DependencyInjection/CachePoolPassTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ public function testChainAdapterPool()
209209
$container->register('cache.adapter.apcu', ApcuAdapter::class)
210210
->setArguments([null, 0, null])
211211
->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'))
213214
->addArgument(['cache.adapter.array', 'cache.adapter.apcu'])
214215
->addTag('cache.pool');
215216
$container->setDefinition('cache.app', new ChildDefinition('cache.chain'))
@@ -224,7 +225,7 @@ public function testChainAdapterPool()
224225
$this->assertSame('cache.chain', $appCachePool->getParent());
225226

226227
$chainCachePool = $container->getDefinition('cache.chain');
227-
$this->assertNotInstanceOf(ChildDefinition::class, $chainCachePool);
228+
$this->assertInstanceOf(ChildDefinition::class, $chainCachePool);
228229
$this->assertCount(2, $chainCachePool->getArgument(0));
229230
$this->assertInstanceOf(ChildDefinition::class, $chainCachePool->getArgument(0)[0]);
230231
$this->assertSame('cache.adapter.array', $chainCachePool->getArgument(0)[0]->getParent());

0 commit comments

Comments
 (0)
0