Rector rule 'ThisCallOnStaticMethodToStaticCallRector'.

https://getrector.com/rule-detail/this-call-on-static-method-to-static-call-rector
This commit is contained in:
supahgreg 2025-10-18 01:48:51 +00:00
parent 7c432749ef
commit f9290ff37a
No known key found for this signature in database
6 changed files with 12 additions and 15 deletions

View File

@ -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]);

View File

@ -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)]);
}
}

View File

@ -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 {

View File

@ -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 {
</script>
<div class="container">
<h1>Feed Debugger: <?= "$feed_id: " . $this->_get_title($feed_id, $_SESSION['uid']) ?></h1>
<h1>Feed Debugger: <?= "$feed_id: " . static::_get_title($feed_id, $_SESSION['uid']) ?></h1>
<div class="content">
<form method="post" action="" dojoType="dijit.form.Form">
<?= \Controls\hidden_tag("op", "Feeds") ?>

View File

@ -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;
}

View File

@ -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");