Address PHPStan warnings in 'include/errorhandler.php'.

This commit is contained in:
wn_ 2021-11-11 20:46:42 +00:00
parent e4b8e2d063
commit 00b86bac39
1 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,8 @@
<?php <?php
function format_backtrace($trace) { /**
* @param array<int, array<string, mixed>> $trace
*/
function format_backtrace($trace): string {
$rv = ""; $rv = "";
$idx = 1; $idx = 1;
@ -39,7 +42,7 @@ function format_backtrace($trace) {
return $rv; return $rv;
} }
function ttrss_error_handler($errno, $errstr, $file, $line) { function ttrss_error_handler(int $errno, string $errstr, string $file, int $line): bool {
/*if (version_compare(PHP_VERSION, '8.0.0', '<')) { /*if (version_compare(PHP_VERSION, '8.0.0', '<')) {
if (error_reporting() == 0 || !$errno) return false; if (error_reporting() == 0 || !$errno) return false;
} else { } else {
@ -59,7 +62,7 @@ function ttrss_error_handler($errno, $errstr, $file, $line) {
return false; return false;
} }
function ttrss_fatal_handler() { function ttrss_fatal_handler(): bool {
$error = error_get_last(); $error = error_get_last();
if ($error !== NULL) { if ($error !== NULL) {