*/
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:----Qlcq69Hr5Lh0HhQvTXdmAOp3JvnC63ms7WqFHJL+ASXagg1BCDDwlFFBcn0aPQYLlvlA3m6057mu0wY4FP8WBiQj7bx2S0L/CHzi36Bv2GrIYFM5Ql79bj+B0wspycsPJHJzGiKwSlCtfhGjA+RM1OYyLt9kKIueOyQDqeQqjh43Oy0JMZXWd0jTOoTvhOPjW6rnmo8MdJqaK20HZW47i9UIgIve1YwGS5yo7KfOhVpfHkt0jTVHY7cMIn8fx06c9DMSCTuHDW9xkOLyUTUafjx5whoo6QfrSaN3NQC9YNuaVGDUEFs1kN6CPNZQSTG3KjeO3wuEJHk1YtGKP2mp95n31/NcSitk+Q3lrWwvfw3jxPHdT/n7JqgUX4F61ERzw3TqCTymBKJVzjLBuDMJMI5mRq2BucouAWHODbaJpu9xzypuH4Iufi7OwbzNu29HXSYcC9Aoco6gUjx2T8oTfzqlzuUNRoDBNSLdeWPjvV76RYHt/Bm0PKyS4esX2YDxr90Zw9wQRnNB4IQ7sVPbjPE9qOH5ZRmqPWIHHkRKP8kh20fu9/V2FnNKHql+fXM7aI7i1UJMjkrC9ZUFS6kHzjWvbTMh8ziLpTnTJPSaCvcGDnNzGLrDWhImx3veqeRXpkbZ2jTFYR3IKL8t440RlJwUKSc/4/8i2fwNSabeOEM=----ATTACHMENT:----Njk3NjMwMTEwMjEwODMzNiAxNTk1MDc1MDE2NzQ4MjE5IDQ0NzIzMDA4MjY0NzYxMzI=