@@ -403,10 +403,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void
403
403
->end ()
404
404
->end ()
405
405
->arrayNode ('supports ' )
406
- ->beforeNormalization ()
407
- ->ifString ()
408
- ->then (fn ($ v ) => [$ v ])
409
- ->end ()
406
+ ->beforeNormalization ()->castToArray ()->end ()
410
407
->prototype ('scalar ' )
411
408
->cannotBeEmpty ()
412
409
->validate ()
@@ -535,20 +532,14 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void
535
532
->example ('is_fully_authenticated() and is_granted( \'ROLE_JOURNALIST \') and subject.getTitle() == \'My first article \'' )
536
533
->end ()
537
534
->arrayNode ('from ' )
538
- ->beforeNormalization ()
539
- ->ifString ()
540
- ->then (fn ($ v ) => [$ v ])
541
- ->end ()
535
+ ->beforeNormalization ()->castToArray ()->end ()
542
536
->requiresAtLeastOneElement ()
543
537
->prototype ('scalar ' )
544
538
->cannotBeEmpty ()
545
539
->end ()
546
540
->end ()
547
541
->arrayNode ('to ' )
548
- ->beforeNormalization ()
549
- ->ifString ()
550
- ->then (fn ($ v ) => [$ v ])
551
- ->end ()
542
+ ->beforeNormalization ()->castToArray ()->end ()
552
543
->requiresAtLeastOneElement ()
553
544
->prototype ('scalar ' )
554
545
->cannotBeEmpty ()
@@ -933,7 +924,7 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode, callable $e
933
924
->children ()
934
925
->arrayNode ('fallbacks ' )
935
926
->info ('Defaults to the value of "default_locale". ' )
936
- ->beforeNormalization ()->ifString ()-> then ( fn ( $ v ) => [ $ v ] )->end ()
927
+ ->beforeNormalization ()->castToArray ( )->end ()
937
928
->prototype ('scalar ' )->end ()
938
929
->defaultValue ([])
939
930
->end ()
@@ -1436,7 +1427,7 @@ private function addLockSection(ArrayNodeDefinition $rootNode, callable $enableI
1436
1427
->end ()
1437
1428
->prototype ('array ' )
1438
1429
->performNoDeepMerging ()
1439
- ->beforeNormalization ()->ifString ()-> then ( fn ( $ v ) => [ $ v ] )->end ()
1430
+ ->beforeNormalization ()->castToArray ( )->end ()
1440
1431
->prototype ('scalar ' )->end ()
1441
1432
->end ()
1442
1433
->end ()
@@ -2226,7 +2217,7 @@ private function addNotifierSection(ArrayNodeDefinition $rootNode, callable $ena
2226
2217
->arrayNode ('channel_policy ' )
2227
2218
->useAttributeAsKey ('name ' )
2228
2219
->prototype ('array ' )
2229
- ->beforeNormalization ()->ifString ()-> then ( fn ( $ v ) => [ $ v ] )->end ()
2220
+ ->beforeNormalization ()->castToArray ( )->end ()
2230
2221
->prototype ('scalar ' )->end ()
2231
2222
->end ()
2232
2223
->end ()
@@ -2442,18 +2433,12 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable
2442
2433
->end ()
2443
2434
->arrayNode ('block_elements ' )
2444
2435
->info ('Configures elements as blocked. Blocked elements are elements the sanitizer should remove from the input, but retain their children. ' )
2445
- ->beforeNormalization ()
2446
- ->ifString ()
2447
- ->then (fn (string $ n ):array => (array )$ n )
2448
- ->end ()
2436
+ ->beforeNormalization ()->castToArray ()->end ()
2449
2437
->scalarPrototype ()->end ()
2450
2438
->end ()
2451
2439
->arrayNode ('drop_elements ' )
2452
2440
->info ('Configures elements as dropped. Dropped elements are elements the sanitizer should remove from the input, including their children. ' )
2453
- ->beforeNormalization ()
2454
- ->ifString ()
2455
- ->then (fn (string $ n ):array => (array )$ n )
2456
- ->end ()
2441
+ ->beforeNormalization ()->castToArray ()->end ()
2457
2442
->scalarPrototype ()->end ()
2458
2443
->end ()
2459
2444
->arrayNode ('allow_attributes ' )