From 5b28a35003a015e29770094932157f13a3f7f5c0 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 9 Jun 2024 20:32:12 +0200 Subject: Pass PHPStan level 9 (#6544) * More PHPStan * More, passing * 4 more files * Update to PHPStan 1.11.4 Needed for fixed bug: Consider numeric-string types after string concat https://github.com/phpstan/phpstan/releases/tag/1.11.4 * Pass PHPStan level 9 Start tracking booleansInConditions * Fix mark as read * Fix doctype * ctype_digit --- lib/lib_rss.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 6bceccc86..ae8744841 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -41,8 +41,7 @@ if (!function_exists('syslog')) { define('STDERR', fopen('php://stderr', 'w')); } function syslog(int $priority, string $message): bool { - // @phpstan-ignore booleanAnd.rightAlwaysTrue - if (COPY_SYSLOG_TO_STDERR && defined('STDERR') && STDERR) { + if (COPY_SYSLOG_TO_STDERR && defined('STDERR') && is_resource(STDERR)) { return fwrite(STDERR, $message . "\n") != false; } return false; @@ -619,9 +618,12 @@ function lazyimg(string $content): string { ) ?? ''; } +/** @return numeric-string */ function uTimeString(): string { $t = @gettimeofday(); - return $t['sec'] . str_pad('' . $t['usec'], 6, '0', STR_PAD_LEFT); + $result = $t['sec'] . str_pad('' . $t['usec'], 6, '0', STR_PAD_LEFT); + /** @var numeric-string @result */ + return $result; } function invalidateHttpCache(string $username = ''): bool { -- cgit v1.2.3