Add config to set default values

This commit is contained in:
brabli
2023-06-26 21:30:55 +01:00
parent e3d3818b10
commit fdab83bd28

View File

@@ -20,6 +20,21 @@ class Configuration implements ConfigurationInterface
private function addValidationRules(ArrayNodeDefinition $rootNode): void
{
// I've split the tree up like this because Intelephense was crying.
// Plus I think it's a little easier to read.
$rootNode
->children()
->arrayNode('default')
->addDefaultsIfNotSet()
->children()
->scalarNode('colour')->defaultValue('primary')->end()
->integerNode('size')->defaultValue(32)->end()
->end()
->end()
->end()
;
$rootNode
->children()
->arrayNode('directories')
@@ -34,6 +49,11 @@ class Configuration implements ConfigurationInterface
->end()
->end()
->end()
->end()
;
$rootNode
->children()
->arrayNode('colours')
->validate()
->ifEmpty()