Skip to content

Commit 35ca5bd

Browse files
committed
[FrameworkBundle] Fix cache pool configuration with one adapter and one provider
1 parent 76085b8 commit 35ca5bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

DependencyInjection/Configuration.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,13 +1012,14 @@ private function addCacheSection(ArrayNodeDefinition $rootNode)
10121012
->prototype('array')
10131013
->fixXmlConfig('adapter')
10141014
->beforeNormalization()
1015-
->ifTrue(function ($v) { return (isset($v['adapters']) || \is_array($v['adapter'] ?? null)) && isset($v['provider']); })
1016-
->thenInvalid('Pool cannot have a "provider" while "adapter" is set to a map')
1015+
->ifTrue(function ($v) { return isset($v['provider']) && \is_array($v['adapters'] ?? $v['adapter'] ?? null) && 1 < \count($v['adapters'] ?? $v['adapter']); })
1016+
->thenInvalid('Pool cannot have a "provider" while more than one adapter is defined')
10171017
->end()
10181018
->children()
10191019
->arrayNode('adapters')
10201020
->performNoDeepMerging()
10211021
->info('One or more adapters to chain for creating the pool, defaults to "cache.app".')
1022+
->beforeNormalization()->castToArray()->end()
10221023
->beforeNormalization()
10231024
->always()->then(function ($values) {
10241025
if ([0] === array_keys($values) && \is_array($values[0])) {

0 commit comments

Comments
 (0)