You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To increase the interoperability it would be useful to have an option for dynamic array definitions in the configuration node builder. Framework agnostic libraries validates the configuration in the factory classes, so there is no need to redefine it for Symfony.
It exists a Symfony Interop Bundle which has support for dynamic array nodes. But this is not needed if we add an option to disable the exception and create a new ArrayNode instead like in the Symfony Interop Bundle.
Here is an example (useDynmicArray()):
classConfigurationimplementsConfigurationInterface
{
publicfunctiongetConfigTreeBuilder()
{
$treeBuilder = newTreeBuilder();
$rootNode = $treeBuilder->root('prooph');
// our factories handles validation and we are flexible with keys$rootNode->ignoreExtraKeys(false);
$rootNode->useDynamicArray(); // <-- new functionalityreturn$treeBuilder;
}
}
The text was updated successfully, but these errors were encountered:
Can you explain what configuration I would be able to do with that new option I wasn't able to create before? I am not sure I understand what you would like to solve.
Instead of throwing an exception, I need to create a new instance of ArrayNode, so the config could be merged. Or do I miss something? Note, that I don't want to define the whole config structure with the tree builder.
For a test case, you can use a Symonfy demo app and add the prooph Symfony bundle and then put the example YAML configuration to your config.yml file and with the debug:config console command you should get the exception message if you change this line to array instead of dynamicArray.
To increase the interoperability it would be useful to have an option for dynamic array definitions in the configuration node builder. Framework agnostic libraries validates the configuration in the factory classes, so there is no need to redefine it for Symfony.
It exists a Symfony Interop Bundle which has support for dynamic array nodes. But this is not needed if we add an option to disable the exception and create a new
ArrayNode
instead like in the Symfony Interop Bundle.Here is an example (
useDynmicArray()
):The text was updated successfully, but these errors were encountered: