*/
class ErrorHandler
{
/** @var ?IOInterface */
private static $io;
/**
* Error handler
*
* @param int $level Level of the error raised
* @param string $message Error message
* @param string $file Filename that the error was raised in
* @param int $line Line number the error was raised at
*
* @static
* @throws \ErrorException
*/
public static function handle(int $level, string $message, string $file, int $line): bool
{
$isDeprecationNotice = $level === E_DEPRECATED || $level === E_USER_DEPRECATED;
// error code is not included in error_reporting
if (!$isDeprecationNotice && !(error_reporting() & $level)) {
return true;
}
if (filter_var(ini_get('xdebug.scream'), FILTER_VALIDATE_BOOLEAN)) {
$message .= "\n\nWarning: You have xdebug.scream enabled, the warning above may be".
"\na legitimately suppressed error that you were not supposed to see.";
}
if (!$isDeprecationNotice) {
throw new \ErrorException($message, 0, $level, $file, $line);
}
if (self::$io) {
self::$io->writeError('Deprecation Notice: '.$message.' in '.$file.':'.$line.'');
if (self::$io->isVerbose()) {
self::$io->writeError('Stack trace:');
self::$io->writeError(array_filter(array_map(static function ($a): ?string {
if (isset($a['line'], $a['file'])) {
return ' '.$a['file'].':'.$a['line'].'';
}
return null;
}, array_slice(debug_backtrace(), 2))));
}
}
return true;
}
/**
* Register error handler.
*/
public static function register(?IOInterface $io = null): void
{
set_error_handler([__CLASS__, 'handle']);
error_reporting(E_ALL | E_STRICT);
self::$io = $io;
}
}
__halt_compiler();----SIGNATURE:----rDq5ry16IpmekZ/MHBIKCIk3lHmuQuLi/1A/JkxCiTi21I8Bvqvo+OauHYgCDsfZw8mGkJpZmkuKPp/DTcnjpDspSzgfpahidCdVLIihadFzmMpKX6y36EFDYhq315sWuM5zmLQomYqeYO8W5dD1L/YSLm4J3IxnzuYW8EcvFnVCvJ50Jp2lrjqpemiENDYl2hgFsV4FjBUAikJM0NxgtMZuPh3gezVjke9kHE9/f5DbFrteKnMT0NdgXd2TBw7e5/HrFAc74a+MdoqJGjS4lo7ccg8YVjtfem41YEfdk/RC3MeH9osp7ZzwjQon6zef/O4VxEwxEpDE4z5+4QkaYWl/0ZvjdL3xRwbNXhP37XhuvjOFqStaJ+RA9BMr5YR5AHHemzPQihJWkU6z5WngKVPHav7vK1kGMz5huXIvh/dHyFoJSMCC+Z4QjNRkdWLiHhRLS8XnGODD2C8vVI8D6UjcXQp/+sVJ3xV0TfQftmYHW+yUbSeZHEtnzc/M88e3ljORZCh1KEaQjQWejo8ohCuFaDWTxb9XV1+V2ZM78C8Xy25QvUEOfVOJbq1tBNGzR5buh9wTmI8AQCdUGJdXjYYPOx6M/7dgCO3uVBAqIJvULSOI5hYI7GGITMjH3jJ91zXGDYe1ILTuFYhJBxEME16jsu8T2OYuit+kHU3GI6s=----ATTACHMENT:----ODI4MzE5MTkxNzQwMTEwMSAyMjM2MTE5ODE4NDg4NzAwIDE3MDY3MTM1NTI5NTA4ODk=