Don't resolve the Deprecation error handler mode until a deprecation is triggered

This commit is contained in:
Gocha Ossinkine 2019-02-14 21:08:19 +05:00 committed by Nicolas Grekas
parent 37b0eeb007
commit 1090b8cb6e

View File

@ -105,8 +105,7 @@ class DeprecationErrorHandler
'remaining vendor' => array(),
);
$deprecationHandler = function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, $getMode, $UtilPrefix, $inVendors) {
$mode = $getMode();
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode) {
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode = $getMode()) {
$ErrorHandler = $UtilPrefix.'ErrorHandler';
return $ErrorHandler::handleError($type, $msg, $file, $line, $context);