[FrameworkBundle] framework.php_errors.log now accept a log level

This commit is contained in:
Amrouche Hamza 2018-03-06 13:55:14 +01:00
parent d65c43ba84
commit 664f821895
No known key found for this signature in database
GPG Key ID: 6968F2785ED4F012
2 changed files with 9 additions and 1 deletions

View File

@ -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.')

View File

@ -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);
}