8000 bug #21986 Stop relying on the $mode argument (greg0ire) · symfony/symfony@f2ae2ed · GitHub
[go: up one dir, main page]

Skip to content

Commit f2ae2ed

Browse files
bug #21986 Stop relying on the $mode argument (greg0ire)
This PR was merged into the 3.3-dev branch. Discussion ---------- 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? | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | yes/no | Deprecations? | yes/no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes/no | Fixed tickets | #21980 | License | MIT | Doc PR | n/a <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- 0d180d5 Stop relying on the $mode argument
2 parents 40d133c + 0d180d5 commit f2ae2ed

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