Closed
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
Symfony version | 3.x |
In config trees is common to see code like the following to turn a value into an array:
->beforeNormalization()
->ifTrue(function ($v) { return !is_array($v); })
->then(function ($v) { return array($v); })
->end()
// ...
->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
You can see it tens of times in Symfony, popular bundles and elsewhere. Could we add a helper method to remove this boilerplate code? Thanks!