PHP8: ErrorHandler fixed accordingly to migration guide.

This commit is contained in:
Kamil Wylegala 2021-02-24 23:08:03 +01:00
parent 3b999b74b9
commit 20419bd82b

View file

@ -204,7 +204,9 @@ class ErrorHandler {
* @return bool true if error was handled
*/
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
if (error_reporting() === 0) {
//PHP8 migration guide: https://www.php.net/manual/en/migration80.incompatible.php
//See: @ operator
if (!(error_reporting() & $code)) {
return false;
}
list($error, $log) = static::mapErrorCode($code);