From a80a5f48a16e7d232168a7aaa68e9a1804235ce1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 18 Dec 2023 17:59:16 +0100 Subject: Pass PHPStan level 8 (#5946) * Pass PHPStan level 8 And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels * Revert wrong replace in comment * Fix PHPStan level 8 * Update PHPStan and other dev dependencies * Remove obsolete comment * noVariableVariables and towards bleedingEdge https://github.com/phpstan/phpstan-strict-rules https://phpstan.org/blog/what-is-bleeding-edge * More bleedingEdge * A bit more PHPStan level 9 * More PHPStan level 9 * Prepare for booleansInConditions Ignore int and null * Revert wrong line * More fixes * Fix keep_max_n_unread * Stricter attribute functions * Stricter callHooks and more PHPStan level 9 * More typing * A tiny more --- app/views/configure/archiving.phtml | 52 ++++++------ app/views/configure/display.phtml | 94 ++++++++++----------- app/views/configure/integration.phtml | 5 +- app/views/configure/reading.phtml | 148 +++++++++++++++++----------------- app/views/configure/shortcut.phtml | 2 +- app/views/configure/system.phtml | 40 ++++----- 6 files changed, 172 insertions(+), 169 deletions(-) (limited to 'app/views/configure') diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 6004cec1b..86b8246e3 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -17,21 +17,21 @@
- ()
@@ -46,10 +46,10 @@
@@ -59,18 +59,18 @@
@@ -81,8 +81,8 @@
@@ -92,8 +92,8 @@
@@ -103,8 +103,8 @@
@@ -114,8 +114,8 @@
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index b48dcbf71..d373c0bb5 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -16,10 +16,10 @@
- - +
@@ -28,15 +28,15 @@
- timezone, $timezones, true)) { - FreshRSS_Context::$user_conf->timezone = ''; + if (!in_array(FreshRSS_Context::userConf()->timezone, $timezones, true)) { + FreshRSS_Context::userConf()->timezone = ''; } ?> - @@ -49,16 +49,16 @@
    themes); $i = 1; $themeAvailable = false; ?> - themes as $theme) { ?> - theme === $theme['id']) { + themes as $theme) { ?> + theme === $theme['id']) { $checked = 'checked="checked"'; $themeAvailable = true; } else { $checked = ''; } ?> value="" - data-leave-validation="theme === $theme['id']) ? 1 : 0 ?>" /> + data-leave-validation="theme === $theme['id']) ? 1 : 0 ?>" />
  • @@ -98,7 +98,7 @@
    -
    theme)?>
    +
    theme)?>
  • @@ -109,14 +109,14 @@
    - + +
    - content_width; ?> + content_width; ?>
    @@ -137,7 +137,7 @@
    - topline_website; ?> + topline_website; ?>
    @@ -158,7 +158,7 @@
    - topline_thumbnail; ?> + topline_thumbnail; ?>
    @@ -201,50 +201,50 @@ topline_read ? ' checked="checked"' : '' ?> - data-leave-validation="topline_read ?>" /> + FreshRSS_Context::userConf()->topline_read ? ' checked="checked"' : '' ?> + data-leave-validation="topline_read ?>" /> topline_favorite ? ' checked="checked"' : '' ?> - data-leave-validation="topline_favorite ?>" /> + FreshRSS_Context::userConf()->topline_favorite ? ' checked="checked"' : '' ?> + data-leave-validation="topline_favorite ?>" /> topline_summary ? 'checked="checked"' : '' ?> - data-leave-validation="topline_summary ?>" /> + FreshRSS_Context::userConf()->topline_summary ? 'checked="checked"' : '' ?> + data-leave-validation="topline_summary ?>" /> topline_display_authors ? ' checked="checked"' : '' ?> - data-leave-validation="topline_display_authors ?>" /> + FreshRSS_Context::userConf()->topline_display_authors ? ' checked="checked"' : '' ?> + data-leave-validation="topline_display_authors ?>" /> topline_date ? ' checked="checked"' : '' ?> - data-leave-validation="topline_date ?>" /> - topline_link ? ' checked="checked"' : '' ?> - data-leave-validation="topline_link ?>" /> + FreshRSS_Context::userConf()->topline_date ? ' checked="checked"' : '' ?> + data-leave-validation="topline_date ?>" /> + topline_link ? ' checked="checked"' : '' ?> + data-leave-validation="topline_link ?>" /> bottomline_read ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_read ?>" /> + FreshRSS_Context::userConf()->bottomline_read ? ' checked="checked"' : '' ?> + data-leave-validation="bottomline_read ?>" /> bottomline_favorite ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_favorite ?>" /> + FreshRSS_Context::userConf()->bottomline_favorite ? ' checked="checked"' : '' ?> + data-leave-validation="bottomline_favorite ?>" /> bottomline_myLabels ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_myLabels ?>" /> + FreshRSS_Context::userConf()->bottomline_myLabels ? ' checked="checked"' : '' ?> + data-leave-validation="bottomline_myLabels ?>" /> bottomline_tags ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_tags ?>" /> + FreshRSS_Context::userConf()->bottomline_tags ? ' checked="checked"' : '' ?> + data-leave-validation="bottomline_tags ?>" /> bottomline_sharing ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_sharing ?>" /> + FreshRSS_Context::userConf()->bottomline_sharing ? ' checked="checked"' : '' ?> + data-leave-validation="bottomline_sharing ?>" /> bottomline_date ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_date ?>" /> + FreshRSS_Context::userConf()->bottomline_date ? ' checked="checked"' : '' ?> + data-leave-validation="bottomline_date ?>" /> bottomline_link ? ' checked="checked"' : '' ?> - data-leave-validation="bottomline_link ?>" /> + FreshRSS_Context::userConf()->bottomline_link ? ' checked="checked"' : '' ?> + data-leave-validation="bottomline_link ?>" /> @@ -255,8 +255,8 @@
    + FreshRSS_Context::userConf()->html5_notif_timeout ?>" + data-leave-validation="html5_notif_timeout ?>" />
    @@ -264,8 +264,8 @@
    diff --git a/app/views/configure/integration.phtml b/app/views/configure/integration.phtml index fc3cc2a32..973ee128f 100644 --- a/app/views/configure/integration.phtml +++ b/app/views/configure/integration.phtml @@ -57,8 +57,11 @@ sharing as $key => $share_options) { + foreach (FreshRSS_Context::userConf()->sharing as $key => $share_options) { $share = FreshRSS_Share::get($share_options['type']); + if ($share === null) { + continue; + } $share->update($share_options); ?> diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index 94cf51977..17fdbe7c3 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -17,10 +17,10 @@
    - + + +
    @@ -28,10 +28,10 @@
    - + + +
    @@ -40,8 +40,8 @@
    + FreshRSS_Context::userConf()->posts_per_page ?>" min="5" max="500" + data-leave-validation="posts_per_page ?>"/>

    @@ -50,8 +50,8 @@
    @@ -61,9 +61,9 @@
    - + +
    @@ -75,14 +75,14 @@
    -
    @@ -92,8 +92,8 @@
    @@ -104,8 +104,8 @@
    @@ -117,32 +117,32 @@
    - + + +
    - + + + +
    - + + + +
    @@ -150,7 +150,7 @@
    - +

    @@ -162,8 +162,8 @@
    @@ -174,8 +174,8 @@
    @@ -186,8 +186,8 @@
    @@ -201,8 +201,8 @@
    @@ -213,8 +213,8 @@
    @@ -226,8 +226,8 @@
    @@ -237,8 +237,8 @@
    @@ -249,8 +249,8 @@
    @@ -261,8 +261,8 @@
    @@ -273,8 +273,8 @@
    @@ -285,8 +285,8 @@
    @@ -297,10 +297,10 @@
    @@ -312,8 +312,8 @@
    @@ -324,8 +324,8 @@
    @@ -335,10 +335,10 @@
    @@ -351,7 +351,7 @@
    @@ -366,8 +366,8 @@
    diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index e578938cd..0d7ee4cb7 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -16,7 +16,7 @@ - shortcuts; ?> + shortcuts; ?>

    diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml index d19698932..09d1fe188 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -16,16 +16,16 @@

    - +
    - +

    @@ -35,7 +35,7 @@
    pubsubhubbub_enabled && Minz_Request::serverIsPublic(FreshRSS_Context::$system_conf->base_url) ? 'checked="checked"' : '' ?> /> + FreshRSS_Context::systemConf()->pubsubhubbub_enabled && Minz_Request::serverIsPublic(FreshRSS_Context::systemConf()->base_url) ? 'checked="checked"' : '' ?> />

    @@ -44,32 +44,32 @@
    - +
    - +
    - +
    - +

    @@ -80,9 +80,9 @@
    @@ -91,8 +91,8 @@
    - + (= )(= )
    @@ -124,8 +124,8 @@ name="force-email-validation" id="force-email-validation" value="1" - force_email_validation ? 'checked="checked"' : '' ?> - data-leave-validation="force_email_validation ?>" + force_email_validation ? 'checked="checked"' : '' ?> + data-leave-validation="force_email_validation ?>" /> -- cgit v1.2.3