From 74ed1e6c5772338f8a18f4cbf63bdfcf2ef9baaf Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 13 Jan 2024 17:02:39 +0100 Subject: Fix PHP 7.4 compatibility (#6038) Some recent PRs have broken PHP 7.4 compatibility due to `mixed` typing. --- app/Utils/dotpathUtil.php | 5 +++-- app/views/helpers/export/opml.phtml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/Utils/dotpathUtil.php b/app/Utils/dotpathUtil.php index aaeb82daa..299b1dcc4 100644 --- a/app/Utils/dotpathUtil.php +++ b/app/Utils/dotpathUtil.php @@ -63,7 +63,7 @@ final class FreshRSS_dotpath_Util * @param mixed $value * @return bool */ - private static function accessible(mixed $value): bool { + private static function accessible($value): bool { return is_array($value) || $value instanceof \ArrayAccess; } @@ -84,7 +84,8 @@ final class FreshRSS_dotpath_Util return false; } - private static function value(mixed $value): mixed { + /** @param mixed $value */ + private static function value($value): mixed { return $value instanceof Closure ? $value() : $value; } diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml index 736854f46..0b53a1ce4 100644 --- a/app/views/helpers/export/opml.phtml +++ b/app/views/helpers/export/opml.phtml @@ -103,7 +103,7 @@ function feedsToOutlines(array $feeds, bool $excludeMutedFeeds = false): array { } // Remove null or invalid attributes - $outline = array_filter($outline, static function (mixed $value) { return (is_string($value) || is_int($value) || is_bool($value)) && $value !== ''; }); + $outline = array_filter($outline, static function ($value) { return (is_string($value) || is_int($value) || is_bool($value)) && $value !== ''; }); $outlines[] = $outline; } -- cgit v1.2.3