Skip to content

Commit

Permalink
Fix error settings
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Nov 19, 2023
1 parent 3728e5f commit 321f6fc
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/Core/Service/ErrorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,26 @@ public static function normalizeMessage(string $message): string
return trim(explode("\n", $message)[0]);
}

public static function getReportLevel(): int
public static function getReportLevel(array|int|null $errors = null): int
{
return E_ALL
& ~E_WARNING
& ~E_DEPRECATED
& ~E_USER_WARNING
& ~E_USER_DEPRECATED
& ~E_USER_NOTICE;
if ($errors === null) {
return E_ALL
& ~E_WARNING
& ~E_DEPRECATED
& ~E_NOTICE
& ~E_USER_WARNING
& ~E_USER_DEPRECATED
& ~E_USER_NOTICE;
}

$level = 0;

foreach ($errors as $error => $enabled) {
if ($enabled) {
$level |= $error;
}
}

return $level;
}
}

0 comments on commit 321f6fc

Please sign in to comment.