From 115724622fa32e1b7981e378e87ccfb770450cb1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 23 Apr 2023 11:58:15 +0200 Subject: PHPStan Level 7 for ten more files (#5327) * PHPStan Level 7 for nine more files * Minor syntax * One more --- app/Models/Themes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/Models/Themes.php') diff --git a/app/Models/Themes.php b/app/Models/Themes.php index ce63b24b2..20d825e4b 100644 --- a/app/Models/Themes.php +++ b/app/Models/Themes.php @@ -11,7 +11,7 @@ class FreshRSS_Themes extends Minz_Model { /** @return array */ public static function getList(): array { return array_values(array_diff( - scandir(PUBLIC_PATH . self::$themesUrl), + scandir(PUBLIC_PATH . self::$themesUrl) ?: [], array('..', '.') )); } @@ -37,7 +37,7 @@ class FreshRSS_Themes extends Minz_Model { if (is_dir($theme_dir)) { $json_filename = $theme_dir . '/metadata.json'; if (file_exists($json_filename)) { - $content = file_get_contents($json_filename); + $content = file_get_contents($json_filename) ?: ''; $res = json_decode($content, true); if ($res && !empty($res['name']) && @@ -75,7 +75,7 @@ class FreshRSS_Themes extends Minz_Model { } self::$themeIconsUrl = self::$themesUrl . $theme_id . '/icons/'; self::$themeIcons = is_dir(PUBLIC_PATH . self::$themeIconsUrl) ? array_fill_keys(array_diff( - scandir(PUBLIC_PATH . self::$themeIconsUrl), + scandir(PUBLIC_PATH . self::$themeIconsUrl) ?: [], array('..', '.') ), 1) : array(); return $infos; -- cgit v1.2.3