Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite83d11b

Browse files
[HttpKernel] detect deprecations thrown by container initialization during tests
1 parent50644d0 commite83d11b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/Symfony/Component/HttpKernel/Kernel.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ protected function initializeContainer()
536536
if (!$cache->isFresh()) {
537537
if ($this->debug) {
538538
$collectedLogs =array();
539-
$previousHandler =set_error_handler(function ($type,$message,$file,$line)use (&$collectedLogs, &$previousHandler) {
539+
$previousHandler =6 <count(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,7));
540+
$previousHandler =$previousHandler ?:set_error_handler(function ($type,$message,$file,$line)use (&$collectedLogs, &$previousHandler) {
540541
if (E_USER_DEPRECATED !==$type &&E_DEPRECATED !==$type) {
541542
return$previousHandler ?$previousHandler($type,$message,$file,$line) :false;
542543
}
@@ -572,7 +573,7 @@ protected function initializeContainer()
572573
$container =$this->buildContainer();
573574
$container->compile();
574575
}finally {
575-
if ($this->debug) {
576+
if ($this->debug &&true !==$previousHandler) {
576577
restore_error_handler();
577578

578579
file_put_contents($this->getCacheDir().'/'.$class.'Deprecations.log',serialize(array_values($collectedLogs)));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp