-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
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()):
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('prooph');
// our factories handles validation and we are flexible with keys
$rootNode->ignoreExtraKeys(false);
$rootNode->useDynamicArray(); // <-- new functionality
return $treeBuilder;
}
}sstok and dragosprotung