Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4a77f44

Browse filesBrowse files
committed
[FrameworkBundle] Fix cache pool configuration with one adapter and one provider
1 parent 53a45b2 commit 4a77f44
Copy full SHA for 4a77f44

File tree

1 file changed

+9
-1
lines changed
Filter options

1 file changed

+9
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,13 +1012,21 @@ 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']); })
1015+
->ifTrue(function ($v) { return \is_array($v['adapter'] ?? null) && isset($v['provider']); })
10161016
->thenInvalid('Pool cannot have a "provider" while "adapter" is set to a map')
10171017
->end()
1018+
->beforeNormalization()
1019+
->ifTrue(function ($v) { return \is_array($v['adapters'] ?? null) && 1 < \count($v['adapters']) && isset($v['provider']); })
1020+
->thenInvalid('Pool cannot have a "provider" while "adapters" contains more than one value')
1021+
->end()
10181022
->children()
10191023
->arrayNode('adapters')
10201024
->performNoDeepMerging()
10211025
->info('One or more adapters to chain for creating the pool, defaults to "cache.app".')
1026+
->beforeNormalization()
1027+
->ifTrue(function ($v) { return !\is_array($v); })
1028+
->thenInvalid('Pool "adapters" must be a map')
1029+
->end()
10221030
->beforeNormalization()
10231031
->always()->then(function ($values) {
10241032
if ([0] === array_keys($values) && \is_array($values[0])) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.