diff options
| author | 2023-04-23 11:58:15 +0200 | |
|---|---|---|
| committer | 2023-04-23 11:58:15 +0200 | |
| commit | 115724622fa32e1b7981e378e87ccfb770450cb1 (patch) | |
| tree | 4d7072768076fd76f2f1877757f3e2e395ab2ded /app/Models/Themes.php | |
| parent | 8abe53d879ef188a5c1cc394894ce211fcfa9f92 (diff) | |
PHPStan Level 7 for ten more files (#5327)
* PHPStan Level 7 for nine more files
* Minor syntax
* One more
Diffstat (limited to 'app/Models/Themes.php')
| -rw-r--r-- | app/Models/Themes.php | 6 |
1 files changed, 3 insertions, 3 deletions
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<string> */ 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; |
