diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 4eea195b99..030f2e7e4b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -833,10 +833,14 @@ class Configuration implements ConfigurationInterface ->info('PHP errors handling configuration') ->addDefaultsIfNotSet() ->children() - ->booleanNode('log') + ->scalarNode('log') ->info('Use the app logger instead of the PHP logger for logging PHP errors.') ->defaultValue($this->debug) ->treatNullLike($this->debug) + ->validate() + ->ifTrue(function ($v) { return !(\is_int($v) || \is_bool($v)); }) + ->thenInvalid('The "php_errors.log" parameter should be either an integer or a boolean.') + ->end() ->end() ->booleanNode('throw') ->info('Throw PHP errors as \ErrorException instances.') diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 8fbc4c2761..480e3610e5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -605,6 +605,10 @@ class FrameworkExtension extends Extension $definition->replaceArgument(1, null); } + if (\is_int($config['log']) && $config['log']) { + $definition->replaceArgument(4, $config['log']); + } + if (!$config['throw']) { $container->setParameter('debug.error_handler.throw_at', 0); }