Skip to content

Commit

Permalink
Fix a bug coming with kernel.debug
Browse files Browse the repository at this point in the history
  • Loading branch information
antarestupin committed Feb 9, 2016
1 parent f4b27c7 commit d86d08c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/AntaresAccessibleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
9 changes: 8 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
*/
class Configuration implements ConfigurationInterface
{
private $debug;

public function __construct($debug)
{
$this->debug = (bool) $debug;
}

/**
* {@inheritdoc}
*/
Expand All @@ -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()
Expand Down

0 comments on commit d86d08c

Please sign in to comment.