diff --git a/DependencyInjection/AntaresAccessibleExtension.php b/DependencyInjection/AntaresAccessibleExtension.php index 7fc88ac..1e944b2 100644 --- a/DependencyInjection/AntaresAccessibleExtension.php +++ b/DependencyInjection/AntaresAccessibleExtension.php @@ -19,7 +19,7 @@ class AntaresAccessibleExtension extends Extension */ public function load(array $configs, ContainerBuilder $container) { - $configuration = new Configuration(); + $configuration = new Configuration($container->getParameter('kernel.debug')); $config = $this->processConfiguration($configuration, $configs); $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 76ef799..1984690 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -12,6 +12,13 @@ */ class Configuration implements ConfigurationInterface { + private $debug; + + public function __construct($debug) + { + $this->debug = (bool) $debug; + } + /** * {@inheritdoc} */ @@ -31,7 +38,7 @@ public function getConfigTreeBuilder() ->arrayNode('constraints_validation') ->addDefaultsIfNotSet() ->children() - ->booleanNode('validate_initialize_values')->defaultValue('%kernel.debug%')->end() + ->booleanNode('validate_initialize_values')->defaultValue($this->debug)->end() ->end() ->end() ->end()