8000 bug #30247 Don't resolve the Deprecation error handler mode until a d… · symfony/symfony@eb32993 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb32993

Browse files
bug #30247 Don't resolve the Deprecation error handler mode until a deprecation is triggered (ossinkine)
This PR was merged into the 3.4 branch. Discussion ---------- Don't resolve the Deprecation error handler mode until a deprecation is triggered | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30047 | License | MIT <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - 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. --> If an error happens before `.env.test` is loaded the mode is set to 0 and cached so SYMFONY_DEPRECATIONS_HELPER is not read from `.env.test`. Commits ------- 1090b8c Don't resolve the Deprecation error handler mode until a deprecation is triggered
2 parents dee2fcb + 1090b8c commit eb32993

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ public static function register($mode = 0)
105105
'remaining vendor' => array(),
106106
);
107107
$deprecationHandler = function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, $getMode, $UtilPrefix, $inVendors) {
108-
$mode = $getMode();
109-
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode) {
108+
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode = $getMode()) {
110109
$ErrorHandler = $UtilPrefix.'ErrorHandler';
111110

112111
return $ErrorHandler::handleError($type, $msg, $file, $line, $context);

0 commit comments

Comments
 (0)
0