-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit 9d9f8e3
committed
feature #61718 [Config] Add argument
This PR was merged into the 7.4 branch.
Discussion
----------
[Config] Add argument `$singular` to `NodeBuilder::arrayNode()` to decouple plurals/singulars from XML
| Q | A
| ------------- | ---
| Branch? | 7.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | -
| License | MIT
The capability of defining plural/singular variants for config node is used not only for XML but also for config builders generation.
The current method to deal with this concern is named `fixXmlConfig()`. It's confusing to say the least. What's also confusing is that the call needs to happen on the parent node.
This PR proposes to add a second argument to the `arrayNode()` method, so that things could be changed like this (example taken from the attached patch):
```diff
$rootNode
- ->fixXmlConfig('role', 'role_hierarchy')
->children()
- ->arrayNode('role_hierarchy')
+ ->arrayNode('role_hierarchy', 'role')
```
I'm not deprecating the `fixXmlConfig()` method - it would be way too early.
~In a follow up PR, I'll try to require setting this second argument (or calling fixXmlConfig) when a prototype is defined. If possible.~
Commits
-------
5ac6e748eb9 [Config] Add argument $singular to NodeBuilder::arrayNode() to decouple plurals/singulars from XML$singular
to NodeBuilder::arrayNode()
to decouple plurals/singulars from XML (nicolas-grekas)File tree
Expand file treeCollapse file tree
3 files changed
+88
-181
lines changedFilter options
- DependencyInjection
- Tests/CacheWarmer
Expand file treeCollapse file tree
3 files changed
+88
-181
lines changed
0 commit comments