8000 Merge branch '7.1' into 7.2 · symfony/error-handler@45f8e57 · GitHub
[go: up one dir, main page]

Skip to content

Commit 45f8e57

Browse files
Merge branch '7.1' into 7.2
* 7.1: Fix ProcessTest - testIgnoringSignal for local [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling [Translation] Fix CSV escape char in `CsvFileLoader` on PHP >= 7.4 [DoctrineBridge] fix messenger bus dispatch inside an active transaction [HttpFoundation] Add tests for uncovered sections treat uninitialized properties referenced by property paths as null [PropertyInfo] Check if property is nullable when using `ReflectionExtractor` properly set up constraint options [ErrorHandler][VarDumper] Remove PHP 8.4 deprecations move adding detailed JSON error messages to the validate phase [Profiler] Add word wrap in tables in dialog to see all the text [Core] Fix & Enhance security arabic translation. [HttpFoundation] Add tests for `MethodRequestMatcher` and `SchemeRequestMatcher`
2 parents 04d41f3 + 2f3e2a8 commit 45f8e57

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

ErrorHandler.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class ErrorHandler
5555
\E_USER_DEPRECATED => 'User Deprecated',
5656
\E_NOTICE => 'Notice',
5757
\E_USER_NOTICE => 'User Notice',
58-
\E_STRICT => 'Runtime Notice',
5958
\E_WARNING => 'Warning',
6059
\E_USER_WARNING => 'User Warning',
6160
\E_COMPILE_WARNING => 'Compile Warning',
@@ -73,7 +72,6 @@ class ErrorHandler
7372
\E_USER_DEPRECATED => [null, LogLevel::INFO],
7473
\E_NOTICE => [null, LogLevel::ERROR],
7574
\E_USER_NOTICE => [null, LogLevel::ERROR],
76-
\E_STRICT => [null, LogLevel::ERROR],
7775
\E_WARNING => [null, LogLevel::ERROR],
7876
\E_USER_WARNING => [null, LogLevel::ERROR],
7977
\E_COMPILE_WARNING => [null, LogLevel::ERROR],
@@ -182,6 +180,11 @@ public function __construct(
182180
?BufferingLogger $bootstrappingLogger = null,
183181
private bool $debug = false,
184182
) {
183+
if (\PHP_VERSION_ID < 80400) {
184+
$this->levels[\E_STRICT] = 'Runtime Notice';
185+
$this->loggers[\E_STRICT] = [null, LogLevel::WARNING];
186+
}
187+
185188
if ($bootstrappingLogger) {
186189
$this->bootstrappingLogger = $bootstrappingLogger;
187190
$this->setDefaultLogger($bootstrappingLogger);

Tests/ErrorHandlerTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ public function testDefaultLogger()
203203
\E_USER_DEPRECATED => [null, LogLevel::INFO],
204204
\E_NOTICE => [$logger, LogLevel::ERROR],
205205
\E_USER_NOTICE => [$logger, LogLevel::CRITICAL],
206-
\E_STRICT => [null, LogLevel::ERROR],
207206
\E_WARNING => [null, LogLevel::ERROR],
208207
\E_USER_WARNING => [null, LogLevel::ERROR],
209208
\E_COMPILE_WARNING => [null, LogLevel::ERROR],
@@ -215,6 +214,11 @@ public function testDefaultLogger()
215214
\E_ERROR => [null, LogLevel::CRITICAL],
216215
\E_CORE_ERROR => [null, LogLevel::CRITICAL],
217216
];
217+
218+
if (\PHP_VERSION_ID < 80400) {
219+
$loggers[\E_STRICT] = [null, LogLevel::ERROR];
220+
}
221+
218222
$this->assertSame($loggers, $handler->setLoggers([]));
219223
} finally {
220224
restore_error_handler();
@@ -440,7 +444,6 @@ public function testBootstrappingLogger()
440444
\E_USER_DEPRECATED => [$bootLogger, LogLevel::INFO],
441445
\E_NOTICE => [$bootLogger, LogLevel::ERROR],
442446
\E_USER_NOTICE => [$bootLogger, LogLevel::ERROR],
443-
\E_STRICT => [$bootLogger, LogLevel::ERROR],
444447
\E_WARNING => [$bootLogger, LogLevel::ERROR],
445448
\E_USER_WARNING => [$bootLogger, LogLevel::ERROR],
446449
\E_COMPILE_WARNING => [$bootLogger, LogLevel::ERROR],
@@ -453,6 +456,10 @@ public function testBootstrappingLogger()
453456
\E_CORE_ERROR => [$bootLogger, LogLevel::CRITICAL],
454457
];
455458

459+
if (\PHP_VERSION_ID < 80400) {
460+
$loggers[\E_STRICT] = [$bootLogger, LogLevel::ERROR];
461+
}
462+
456463
$this->assertSame($loggers, $handler->setLoggers([]));
457464

458465
$handler->handleError(\E_DEPRECATED, 'Foo message', __FILE__, 123, []);

0 commit comments

Comments
 (0)
0