@@ -132,10 +132,10 @@ private function addRoleHierarchySection(ArrayNodeDefinition $rootNode)
132
132
->useAttributeAsKey ('id ' )
133
133
->prototype ('array ' )
134
134
->performNoDeepMerging ()
135
- ->beforeNormalization ()->ifString ()->then (function ($ v ) { return array ('value ' => $ v ); })->end ()
135
+ ->beforeNormalization ()->ifString ()->then (function ($ v ) { return array ('value ' => $ v ); })->end ()
136
136
->beforeNormalization ()
137
- ->ifTrue (function ($ v ) { return is_array ($ v ) && isset ($ v ['value ' ]); })
138
- ->then (function ($ v ) { return preg_split ('/\s*,\s*/ ' , $ v ['value ' ]); })
137
+ ->ifTrue (function ($ v ) { return is_array ($ v ) && isset ($ v ['value ' ]); })
138
+ ->then (function ($ v ) { return preg_split ('/\s*,\s*/ ' , $ v ['value ' ]); })
139
139
->end ()
140
140
->prototype ('scalar ' )->end ()
141
141
->end ()
@@ -162,19 +162,19 @@ private function addAccessControlSection(ArrayNodeDefinition $rootNode)
162
162
->end ()
163
163
->scalarNode ('host ' )->defaultNull ()->end ()
164
164
->arrayNode ('ips ' )
165
- ->beforeNormalization ()->ifString ()->then (function ($ v ) { return array ($ v ); })->end ()
165
+ ->beforeNormalization ()->ifString ()->then (function ($ v ) { return array ($ v ); })->end ()
166
166
->prototype ('scalar ' )->end ()
167
167
->end ()
168
168
->arrayNode ('methods ' )
169
- ->beforeNormalization ()->ifString ()->then (function ($ v ) { return preg_split ('/\s*,\s*/ ' , $ v ); })->end ()
169
+ ->beforeNormalization ()->ifString ()->then (function ($ v ) { return preg_split ('/\s*,\s*/ ' , $ v ); })->end ()
170
170
->prototype ('scalar ' )->end ()
171
171
->end ()
172
172
->scalarNode ('allow_if ' )->defaultNull ()->end ()
173
173
->end ()
174
174
->fixXmlConfig ('role ' )
175
175
->children ()
176
176
->arrayNode ('roles ' )
177
- ->beforeNormalization ()->ifString ()->then (function ($ v ) { return preg_split ('/\s*,\s*/ ' , $ v ); })->end ()
177
+ ->beforeNormalization ()->ifString ()->then (function ($ v ) { return preg_split ('/\s*,\s*/ ' , $ v ); })->end ()
178
178
->prototype ('scalar ' )->end ()
179
179
->end ()
180
180
->end ()
@@ -213,25 +213,25 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
213
213
->treatTrueLike (array ())
214
214
->canBeUnset ()
215
215
->beforeNormalization ()
216
- ->ifTrue (function ($ v ) { return isset ($ v ['csrf_provider ' ]) && isset ($ v ['csrf_token_generator ' ]); })
216
+ ->ifTrue (function ($ v ) { return isset ($ v ['csrf_provider ' ]) && isset ($ v ['csrf_token_generator ' ]); })
217
217
->thenInvalid ("You should define a value for only one of 'csrf_provider' and 'csrf_token_generator' on a security firewall. Use 'csrf_token_generator' as this replaces 'csrf_provider'. " )
218
218
->end ()
219
219
->beforeNormalization ()
220
- ->ifTrue (function ($ v ) { return isset ($ v ['intention ' ]) && isset ($ v ['csrf_token_id ' ]); })
220
+ ->ifTrue (function ($ v ) { return isset ($ v ['intention ' ]) && isset ($ v ['csrf_token_id ' ]); })
221
221
->thenInvalid ("You should define a value for only one of 'intention' and 'csrf_token_id' on a security firewall. Use 'csrf_token_id' as this replaces 'intention'. " )
222
222
->end ()
223
223
->beforeNormalization ()
224
- ->ifTrue (function ($ v ) { return isset ($ v ['csrf_provider ' ]); })
225
- ->then (function ($ v ) {
224
+ ->ifTrue (function ($ v ) { return isset ($ v ['csrf_provider ' ]); })
225
+ ->then (function ($ v ) {
226
226
$ v ['csrf_token_generator ' ] = $ v ['csrf_provider ' ];
227
227
unset($ v ['csrf_provider ' ]);
228
228
229
229
return $ v ;
230
230
})
231
231
->end ()
232
232
->beforeNormalization ()
233
- ->ifTrue (function ($ v ) { return isset ($ v ['intention ' ]); })
234
- ->then (function ($ v ) {
233
+ ->ifTrue (function ($ v ) { return isset ($ v ['intention ' ]); })
234
+ ->then (function ($ v ) {
235
235
$ v ['csrf_token_id ' ] = $ v ['intention ' ];
236
236
unset($ v ['intention ' ]);
237
237
@@ -251,8 +251,8 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
251
251
->children ()
252
252
->arrayNode ('delete_cookies ' )
253
253
->beforeNormalization ()
254
- ->ifTrue (function ($ v ) { return is_array ($ v ) && is_int (key ($ v )); })
255
- ->then (function ($ v ) { return array_map (function ($ v ) { return array ('name ' => $ v ); }, $ v ); })
254
+ ->ifTrue (function ($ v ) { return is_array ($ v ) && is_int (key ($ v )); })
255
+ ->then (function ($ v ) { return array_map (function ($ v ) { return array ('name ' => $ v ); }, $ v ); })
256
256
->end ()
257
257
->useAttributeAsKey ('name ' )
258
258
->prototype ('array ' )
@@ -306,10 +306,10 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
306
306
$ firewallNodeBuilder
307
307
->end ()
308
308
->validate ()
309
- ->ifTrue (function ($ v ) {
309
+ ->ifTrue (function ($ v ) {
310
310
return true === $ v ['security ' ] && isset ($ v ['pattern ' ]) && !isset ($ v ['request_matcher ' ]);
311
311
})
312
- ->then (function ($ firewall ) use ($ abstractFactoryKeys ) {
312
+ ->then (function ($ firewall ) use ($ abstractFactoryKeys ) {
313
313
foreach ($ abstractFactoryKeys as $ k ) {
314
314
if (!isset ($ firewall [$ k ]['check_path ' ])) {
315
315
continue ;
@@ -359,7 +359,7 @@ private function addProvidersSection(ArrayNodeDefinition $rootNode)
359
359
->arrayNode ('providers ' )
360
360
->beforeNormalization ()
361
361
->ifString ()
362
- ->then (function ($ v ) { return preg_split ('/\s*,\s*/ ' , $ v ); })
362
+ ->then (function ($ v ) { return preg_split ('/\s*,\s*/ ' , $ v ); })
363
363
->end ()
364
364
->prototype ('scalar ' )->end ()
365
365
->end ()
@@ -377,11 +377,11 @@ private function addProvidersSection(ArrayNodeDefinition $rootNode)
377
377
378
378
$ providerNodeBuilder
379
379
->validate ()
380
- ->ifTrue (function ($ v ){return count ($ v ) > 1 ;})
380
+ ->ifTrue (function ($ v ) {return count ($ v ) > 1 ;})
381
381
->thenInvalid ('You cannot set multiple provider types for the same provider ' )
382
382
->end ()
383
383
->validate ()
384
- ->ifTrue (function ($ v ){return count ($ v ) === 0 ;})
384
+ ->ifTrue (function ($ v ) {return count ($ v ) === 0 ;})
385
385
->thenInvalid ('You must set a provider definition for the provider. ' )
386
386
->end ()
387
387
;
@@ -406,7 +406,7 @@ private function addEncodersSection(ArrayNodeDefinition $rootNode)
406
406
->prototype ('array ' )
407
407
->canBeUnset ()
408
408
->performNoDeepMerging ()
409
- ->beforeNormalization ()->ifString ()->then (function ($ v ) { return array ('algorithm ' => $ v ); })->end ()
409
+ ->beforeNormalization ()->ifString ()->then (function ($ v ) { return array ('algorithm ' => $ v ); })->end ()
410
410
->children ()
411
411
->scalarNode ('algorithm ' )->cannotBeEmpty ()->end ()
412
412
->scalarNode ('hash_algorithm ' )->info ('Name of hashing algorithm for PBKDF2 (i.e. sha256, sha512, etc..) See hash_algos() for a list of supported algorithms. ' )->defaultValue ('sha512 ' )->end ()
0 commit comments