Stop relying on the $mode argument
When registering the error handler, simple-phpunit might be used, and in that case, the bootstrap process will not have environment variables defined inside phpunit.xml.dist . This means `$mode` might differ when registering the error handler, and when an error is triggered. This raises a question: should the $mode argument be removed to avoid similar errors in the future?
This commit is contained in:
parent
40d133c29a
commit
0d180d5994
@ -90,17 +90,13 @@ class DeprecationErrorHandler
|
||||
'remainingCount' => 0,
|
||||
'legacyCount' => 0,
|
||||
'otherCount' => 0,
|
||||
'remaining vendorCount' => 0,
|
||||
'unsilenced' => array(),
|
||||
'remaining' => array(),
|
||||
'legacy' => array(),
|
||||
'other' => array(),
|
||||
'remaining vendor' => array(),
|
||||
);
|
||||
if (self::MODE_WEAK_VENDORS === $mode) {
|
||||
$deprecations += array(
|
||||
'remaining vendorCount' => 0,
|
||||
'remaining vendor' => array(),
|
||||
);
|
||||
}
|
||||
$deprecationHandler = function ($type, $msg, $file, $line, $context) use (&$deprecations, $getMode, $UtilPrefix, $inVendors) {
|
||||
$mode = $getMode();
|
||||
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode) {
|
||||
|
Reference in New Issue
Block a user