8000 Stop relying on the $mode argument · symfony/symfony@0d180d5 · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit 0d180d5

Browse files
author
Grégoire Paris
committed
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?
1 parent 40d133c commit 0d180d5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,13 @@ public static function register($mode = 0)
9090
'remainingCount' => 0,
9191
'legacyCount' => 0,
9292
'otherCount' => 0,
93+
'remaining vendorCount' => 0,
9394
'unsilenced' => array(),
9495
'remaining' => array(),
9596
'legacy' => array(),
9697
'other' => array(),
98+
'remaining vendor' => array(),
9799
);
98-
if (self::MODE_WEAK_VENDORS === $mode) {
99-
$deprecations += array(
100-
'remaining vendorCount' => 0,
101-
'remaining vendor' => array(),
102-
);
103-
}
104100
$deprecationHandler = function ($type, $msg, $file, $line, $context) use (&$deprecations, $getMode, $UtilPrefix, $inVendors) {
105101
$mode = $getMode();
106102
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode) {

0 commit comments

Comments
 (0)
0