From f9290ff37af46436cff3c65e361e04a08fbde822 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Sat, 18 Oct 2025 01:48:51 +0000 Subject: [PATCH] Rector rule 'ThisCallOnStaticMethodToStaticCallRector'. https://getrector.com/rule-detail/this-call-on-static-method-to-static-call-rector --- classes/API.php | 7 ++----- classes/Article.php | 4 ++-- classes/Config.php | 2 +- classes/Feeds.php | 6 +++--- classes/Handler_Public.php | 2 +- classes/RPC.php | 6 +++--- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/classes/API.php b/classes/API.php index 8871c285f..4454d11b8 100644 --- a/classes/API.php +++ b/classes/API.php @@ -124,7 +124,7 @@ class API extends Handler { $offset = (int) clean($_REQUEST["offset"] ?? 0); $include_nested = self::_param_to_bool($_REQUEST["include_nested"] ?? false); - $feeds = $this->_api_get_feeds($cat_id, $unread_only, $limit, $offset, $include_nested); + $feeds = self::_api_get_feeds($cat_id, $unread_only, $limit, $offset, $include_nested); return $this->_wrap(self::STATUS_OK, $feeds); } @@ -218,10 +218,7 @@ class API extends Handler { $search = clean($_REQUEST["search"] ?? ""); - [$headlines, $headlines_header] = $this->_api_get_headlines($feed_id, $limit, $offset, - $filter, $is_cat, $show_excerpt, $show_content, $view_mode, $override_order, - $include_attachments, $since_id, $search, - $include_nested, $sanitize_content, $force_update, $excerpt_length, $check_first_id, $skip_first_id_check); + [$headlines, $headlines_header] = self::_api_get_headlines($feed_id, $limit, $offset, $filter, $is_cat, $show_excerpt, $show_content, $view_mode, $override_order, $include_attachments, $since_id, $search, $include_nested, $sanitize_content, $force_update, $excerpt_length, $check_first_id, $skip_first_id_check); if ($include_header) { return $this->_wrap(self::STATUS_OK, [$headlines_header, $headlines]); diff --git a/classes/Article.php b/classes/Article.php index 2bb8e5c81..99b8a24e5 100644 --- a/classes/Article.php +++ b/classes/Article.php @@ -237,7 +237,7 @@ class Article extends Handler_Protected { $this->pdo->commit(); // get latest tags from the database, original $tags is sometimes JSON-encoded as a hash ({}) - ??? - print json_encode(["id" => (int)$id, "tags" => $this->_get_tags($id)]); + print json_encode(["id" => (int)$id, "tags" => static::_get_tags($id)]); } function completeTags(): void { @@ -286,7 +286,7 @@ class Article extends Handler_Protected { Labels::remove_article($id, $label, $_SESSION["uid"]); array_push($reply["labels-for"], - ["id" => (int)$id, "labels" => $this->_get_labels($id)]); + ["id" => (int)$id, "labels" => static::_get_labels($id)]); } } diff --git a/classes/Config.php b/classes/Config.php index 0f7e49128..fb6fd537c 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -470,7 +470,7 @@ class Config { private function _get(string $param): bool|int|string { [$value, $type_hint] = $this->params[$param]; - return $this->cast_to($value, $type_hint); + return static::cast_to($value, $type_hint); } private function _add(string $param, string $default, int $type_hint): void { diff --git a/classes/Feeds.php b/classes/Feeds.php index d25f8b042..70fa718de 100644 --- a/classes/Feeds.php +++ b/classes/Feeds.php @@ -80,7 +80,7 @@ class Feeds extends Handler_Protected { } if ($method_split[0] == "MarkAllReadGR") { - $this->_catchup($method_split[1], false); + static::_catchup($method_split[1], false); } // FIXME: might break tag display? @@ -142,7 +142,7 @@ class Feeds extends Handler_Protected { "order_by" => $order_by ]; - $qfh_ret = $this->_get_headlines($params); + $qfh_ret = static::_get_headlines($params); } $vfeed_group_enabled = Prefs::get(Prefs::VFEED_GROUP_BY_FEED, $_SESSION['uid'], $profile) && @@ -673,7 +673,7 @@ class Feeds extends Handler_Protected {
-

Feed Debugger: _get_title($feed_id, $_SESSION['uid']) ?>

+

Feed Debugger:

diff --git a/classes/Handler_Public.php b/classes/Handler_Public.php index d88d8698c..a24c5ec79 100644 --- a/classes/Handler_Public.php +++ b/classes/Handler_Public.php @@ -628,7 +628,7 @@ class Handler_Public extends Handler { if (!Config::get(Config::SINGLE_USER_MODE) && ($_SESSION["access_level"] ?? 0) < 10) { $_SESSION["login_error_msg"] = __("Your access level is insufficient to run this script."); - $this->_render_login_form(); + static::_render_login_form(); exit; } diff --git a/classes/RPC.php b/classes/RPC.php index 319be3593..b7ed183a0 100644 --- a/classes/RPC.php +++ b/classes/RPC.php @@ -102,7 +102,7 @@ class RPC extends Handler_Protected { function getRuntimeInfo(): void { $reply = [ - 'runtime-info' => $this->_make_runtime_info() + 'runtime-info' => static::_make_runtime_info() ]; print json_encode($reply); @@ -201,7 +201,7 @@ class RPC extends Handler_Protected { $reply = []; $reply['init-params'] = $this->_make_init_params(); - $reply['runtime-info'] = $this->_make_runtime_info(); + $reply['runtime-info'] = static::_make_runtime_info(); $reply['translations'] = $this->_translations_as_array(); print json_encode($reply); @@ -393,7 +393,7 @@ class RPC extends Handler_Protected { $params["self_url_prefix"] = Config::get_self_url(); $params["max_feed_id"] = (int) $max_feed_id; $params["num_feeds"] = (int) $num_feeds; - $params["hotkeys"] = $this->get_hotkeys_map(); + $params["hotkeys"] = static::get_hotkeys_map(); $params["widescreen"] = (int) Prefs::get(Prefs::WIDESCREEN_MODE, $_SESSION['uid'], $profile); $params["icon_indicator_white"] = $this->image_to_base64("images/indicator_white.gif"); $params["icon_oval"] = $this->image_to_base64("images/oval.svg");