summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-09-29 20:02:59 +0300
committerAndrew Dolgov <[email protected]>2022-09-29 20:02:59 +0300
commit42bc1620b8deda73b96b2e0029c6de79daa5ccca (patch)
tree1481290a1e82e3caade53741165cffa41432cef2 /classes
parent3545d3ba83a486b077b2d1d141ea871bb47a29fb (diff)
make phpstan happy
Diffstat (limited to 'classes')
-rwxr-xr-xclasses/api.php20
-rwxr-xr-xclasses/feeds.php3
2 files changed, 14 insertions, 9 deletions
diff --git a/classes/api.php b/classes/api.php
index 2416dd7c9..262d5c5bc 100755
--- a/classes/api.php
+++ b/classes/api.php
@@ -550,9 +550,10 @@ class API extends Handler {
foreach ($vfeeds as $feed) {
if (!implements_interface($feed['sender'], 'IVirtualFeed'))
continue;
-
+
+ /** @var IVirtualFeed $feed['sender'] */
$unread = $feed['sender']->get_unread($feed['id']);
-
+
if ($unread || !$unread_only) {
$row = [
'id' => PluginHost::pfeed_to_feed_id($feed['id']),
@@ -697,11 +698,14 @@ class API extends Handler {
"skip_first_id_check" => $skip_first_id_check
);
+ $qfh_ret = [];
+
if (!$is_cat && is_numeric($feed_id) && $feed_id < PLUGIN_FEED_BASE_INDEX && $feed_id > LABEL_BASE_INDEX) {
- /** @var IVirtualFeed|false $handler */
$pfeed_id = PluginHost::feed_to_pfeed_id($feed_id);
+
+ /** @var IVirtualFeed|false $handler */
$handler = PluginHost::getInstance()->get_feed_handler($pfeed_id);
-
+
if ($handler) {
$params = array(
"feed" => $feed_id,
@@ -716,12 +720,12 @@ class API extends Handler {
"check_first_id" => $check_first_id,
"skip_first_id_check" => $skip_first_id_check
);
-
+
$qfh_ret = $handler->get_headlines($pfeed_id, $params);
}
-
+
} else {
-
+
$params = array(
"feed" => $feed_id,
"limit" => $limit,
@@ -735,7 +739,7 @@ class API extends Handler {
"check_first_id" => $check_first_id,
"skip_first_id_check" => $skip_first_id_check
);
-
+
$qfh_ret = Feeds::_get_headlines($params);
}
diff --git a/classes/feeds.php b/classes/feeds.php
index 3801f1511..37ce77aa9 100755
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -667,7 +667,7 @@ class Feeds extends Handler_Protected {
}
Debug::set_enabled(true);
- Debug::set_loglevel(Debug::map_loglevel($xdebug));
+ Debug::set_loglevel((int)Debug::map_loglevel($xdebug));
$feed_id = (int)$_REQUEST["feed_id"];
$do_update = ($_REQUEST["action"] ?? "") == "do_update";
@@ -969,6 +969,7 @@ class Feeds extends Handler_Protected {
$feed_id = PluginHost::feed_to_pfeed_id($feed);
$handler = PluginHost::getInstance()->get_feed_handler($feed_id);
if (implements_interface($handler, 'IVirtualFeed')) {
+ /** @var IVirtualFeed $handler */
return $handler->get_unread($feed_id);
} else {
return 0;