File tree 1 file changed +9
-1
lines changed
src/Symfony/Bundle/FrameworkBundle/DependencyInjection
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1012,14 +1012,22 @@ private function addCacheSection(ArrayNodeDefinition $rootNode)
1012
1012
->prototype ('array ' )
1013
1013
->fixXmlConfig ('adapter ' )
1014
1014
->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 ' ]); })
1016
1016
->thenInvalid ('Pool cannot have a "provider" while "adapter" is set to a map ' )
1017
1017
->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 ()
1018
1022
->children ()
1019
1023
->arrayNode ('adapters ' )
1020
1024
->performNoDeepMerging ()
1021
1025
->info ('One or more adapters to chain for creating the pool, defaults to "cache.app". ' )
1022
1026
->beforeNormalization ()
1027
+ ->beforeNormalization ()
1028
+ ->ifTrue (function ($ v ) { return !\is_array ($ v ); })
1029
+ ->thenInvalid ('Pool "adapters" must be a map ' )
1030
+ ->end ()
1023
1031
->always ()->then (function ($ values ) {
1024
1032
if ([0 ] === array_keys ($ values ) && \is_array ($ values [0 ])) {
1025
1033
return $ values [0 ];
You can’t perform that action at this time.
0 commit comments