From 62f32ccadff77594f5b8e3ad24c4c2541ff35885 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 7 Aug 2025 22:19:45 +0200 Subject: PHPStan: finalise strictArrayFilter (#7794) As well as reportPossiblyNonexistentConstantArrayOffset. And disable PHPStan-next from GitHub Action, since the work is completed for now. --- lib/lib_rss.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 8954f9921..480152400 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -231,8 +231,8 @@ function format_bytes(int $bytes, int $precision = 2, string $system = 'IEC'): s return format_number($bytes, $precision); } $bytes = max(intval($bytes), 0); - $pow = $bytes === 0 ? 0 : floor(log($bytes) / log($base)); - $pow = min($pow, count($units) - 1); + $pow = $bytes === 0 ? 0 : (int)floor(log($bytes) / log($base)); + $pow = min(max(0, $pow), count($units) - 1); $bytes /= pow($base, $pow); return format_number($bytes, $precision) . ' ' . $units[$pow]; } -- cgit v1.2.3