We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
rules
1 parent fdd21c4 commit 54a57b4Copy full SHA for 54a57b4
DependencyInjection/Configuration.php
@@ -201,6 +201,18 @@ private function addFormatListenerSection(ArrayNodeDefinition $rootNode)
201
->fixXmlConfig('rule', 'rules')
202
->addDefaultsIfNotSet()
203
->canBeUnset()
204
+ ->beforeNormalization()
205
+ ->ifTrue(function ($v) {
206
+ // check if we got an assoc array in rules
207
+ return isset($v['rules'])
208
+ && is_array($v['rules'])
209
+ && array_keys($v['rules']) !== range(0, count($v['rules']) - 1);
210
+ })
211
+ ->then(function($v) {
212
+ $v['rules'] = array($v['rules']);
213
+ return $v;
214
215
+ ->end()
216
->children()
217
->arrayNode('rules')
218
->cannotBeOverwritten()
0 commit comments