8000 minor #33031 [HttpKernel] Clarify error handler restoring process aga… · fabpot/symfony@e48d2c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e48d2c1

Browse files
minor symfony#33031 [HttpKernel] Clarify error handler restoring process again (fancyweb)
This PR was merged into the 3.4 branch. Discussion ---------- [HttpKernel] Clarify error handler restoring process again | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets |symfony#33024 | License | MIT | Doc PR | - Commits ------- 4ee54f0 [HttpKernel] Clarify error handler restoring process again
2 parents 854f5d1 + 4ee54f0 commit e48d2c1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,9 @@ protected function initializeContainer()
597597
return;
598598
}
599599

600-
if ($this->debug) {
600+
if ($collectDeprecations = $this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) {
601601
$collectedLogs = [];
602-
$previousHandler = \defined('PHPUNIT_COMPOSER_INSTALL');
603-
$previousHandler = $previousHandler ?: set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
602+
$previousHandler = set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
604603
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
605604
return $previousHandler ? $previousHandler($type, $message, $file, $line) : false;
606605
}
@@ -636,7 +635,7 @@ protected function initializeContainer()
636635
$container = $this->buildContainer();
637636
$container->compile();
638637
} finally {
639-
if ($this->debug && true !== $previousHandler) {
638+
if ($collectDeprecations) {
640639
restore_error_handler();
641640

642641
file_put_contents($cacheDir.'/'.$class.'Deprecations.log', serialize(array_values($collectedLogs)));

0 commit comments

Comments
 (0)
0