[PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file

This commit is contained in:
Sören Bernstein 2018-09-20 09:27:29 +02:00 committed by Nicolas Grekas
parent e0e5e83732
commit 3cd929bee0

View File

@ -54,7 +54,11 @@ class DeprecationErrorHandler
if (false === $mode) {
$mode = getenv('SYMFONY_DEPRECATIONS_HELPER');
}
if (DeprecationErrorHandler::MODE_WEAK !== $mode && DeprecationErrorHandler::MODE_WEAK_VENDORS !== $mode && (!isset($mode[0]) || '/' !== $mode[0])) {
if (DeprecationErrorHandler::MODE_DISABLED !== $mode
&& DeprecationErrorHandler::MODE_WEAK !== $mode
&& DeprecationErrorHandler::MODE_WEAK_VENDORS !== $mode
&& (!isset($mode[0]) || '/' !== $mode[0])
) {
$mode = preg_match('/^[1-9][0-9]*$/', $mode) ? (int) $mode : 0;
}