From 839e9ed7e0021e64904143e24560998be053a7c9 Mon Sep 17 00:00:00 2001 From: Sullivan SENECHAL Date: Sun, 7 Jun 2015 11:34:26 +0200 Subject: [PATCH] Improve true/false/null default values on configuration --- DependencyInjection/Configuration.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 7b491d7..2baac26 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -27,7 +27,7 @@ class Configuration implements ConfigurationInterface ->prototype('scalar') ->end() ->end() - ->booleanNode('default_sections_opened')->defaultValue(true)->end() + ->booleanNode('default_sections_opened')->defaultTrue()->end() ->arrayNode('motd') ->addDefaultsIfNotSet() ->children() @@ -132,7 +132,7 @@ class Configuration implements ConfigurationInterface }) ->end() ->end() - ->booleanNode('entity_to_choice')->defaultValue(true)->end() + ->booleanNode('entity_to_choice')->defaultTrue()->end() ->end() ->end() ->arrayNode('swagger') @@ -147,10 +147,10 @@ class Configuration implements ConfigurationInterface ->children() ->scalarNode('title')->defaultValue('Symfony2')->end() ->scalarNode('description')->defaultValue('My awesome Symfony2 app!')->end() - ->scalarNode('TermsOfServiceUrl')->defaultValue(null)->end() - ->scalarNode('contact')->defaultValue(null)->end() - ->scalarNode('license')->defaultValue(null)->end() - ->scalarNode('licenseUrl')->defaultValue(null)->end() + ->scalarNode('TermsOfServiceUrl')->defaultNull()->end() + ->scalarNode('contact')->defaultNull()->end() + ->scalarNode('license')->defaultNull()->end() + ->scalarNode('licenseUrl')->defaultNull()->end() ->end() ->end() ->end() @@ -158,7 +158,7 @@ class Configuration implements ConfigurationInterface ->arrayNode('cache') ->addDefaultsIfNotSet() ->children() - ->booleanNode('enabled')->defaultValue(false)->end() + ->booleanNode('enabled')->defaultFalse()->end() ->scalarNode('file')->defaultValue('%kernel.cache_dir%/api-doc.cache')->end() ->end() ->end()