*/
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 && 0 === (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 !== null) {
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)), function (?string $line) {
return $line !== null;
}));
}
}
return true;
}
/**
* Register error handler.
*/
public static function register(?IOInterface $io = null): void
{
set_error_handler([__CLASS__, 'handle']);
error_reporting(E_ALL);
self::$io = $io;
}
}__halt_compiler();----SIGNATURE:----LNL5QSp6zV+Uc6CF41lhZtNpy++wf9uAR3J0Q/7S4bOAzSxYJTgSKuxWXVeDSStobjb1voqYaCVHE4RNVKB9Y3TkIFauWfJu+Y14sNNEYIoYbv9T1HMLTDjixM0C9ZIKePGy6YhVdRXVed9dFkyW9Dsvr3kwpRFnHeUaxNrrKaPtsi+2Ffv4+6XsT3YQDjnhG4OcZgBZ5KxasyE6msNo1oS/H9FDyhKhbWPKXUmscZHf+5uBLnFip3vFnMZOYx+AseMfkQmnKZVRA5ZMUi+wpOglFB27F2ZPT+7jd45eBNhQnDv97PhAq9UJ1dhVv+iROi+2MwEp8u133mduhlcuEGXnp/G2A1GATN41n4f7rqaOc7ZkC4zJo0QXbMWKtEb0qDel2fifvrsLvaOidDlzNYmoQIdA+YfKV6tjCPebPTD/lfgb/gW+Txq/GWKu6Dzus5Yd7Kyy+bEu27h9mERPNHJkTUSVJxegzxHM4KuBQ4caThyrARqKeeVcMdg/TqNurcC7oJoZDX7z7hRsOhcESP3NryWqhmrtHxJeKuvjvTrl7Zwxd4DTPrAGDSD+/OaNGRQwVUsVVGGhcjCMqoCcVCi48bPJw2eI/Tn7wP3E/c2gte5emhrB3regoNnS18Gs50KfvxiMM0FonoyRGOulBUe1odKX/S7oWYgcH5r7QHE=----ATTACHMENT:----NzkxNTEyNjY4MzMyODcwNiAxNTY5MDgwNDIwNzgyMzE3IDE4Nzk1MDE0ODEwMzE1Mzg=