Skip to content

Commit 6ad7e60

Browse files
mvoriseksebastianbergmann
authored andcommitted
replace supressed detection of @ (3739 issue)
1 parent 4986438 commit 6ad7e60

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Runner/ErrorHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
use const E_ERROR;
1818
use const E_NOTICE;
1919
use const E_PARSE;
20+
use const E_RECOVERABLE_ERROR;
2021
use const E_STRICT;
2122
use const E_USER_DEPRECATED;
23+
use const E_USER_ERROR;
2224
use const E_USER_NOTICE;
2325
use const E_USER_WARNING;
2426
use const E_WARNING;
@@ -37,6 +39,7 @@
3739
final class ErrorHandler
3840
{
3941
private const UNHANDLEABLE_LEVELS = E_ERROR | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING;
42+
private const UNSUPPRESSEABLE_LEVELS = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR;
4043
private static ?self $instance = null;
4144
private ?Baseline $baseline = null;
4245
private bool $enabled = false;
@@ -52,7 +55,7 @@ public static function instance(): self
5255
*/
5356
public function __invoke(int $errorNumber, string $errorString, string $errorFile, int $errorLine): bool
5457
{
55-
$suppressed = !($errorNumber & error_reporting());
58+
$suppressed = (error_reporting() & ~self::UNSUPPRESSEABLE_LEVELS) === 0;
5659

5760
if ($suppressed && (new ExcludeList)->isExcluded($errorFile)) {
5861
return false;

0 commit comments

Comments
 (0)