diff options
author | Andrew Dolgov <[email protected]> | 2021-02-06 17:56:47 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-06 17:56:47 +0300 |
commit | 41fc03287e889d4dc7ac60a93832b79065c041cb (patch) | |
tree | 8dc463ed8fa28ccbd762cab0088b5151b89dbb7e /classes/api.php | |
parent | c94f1b6ff8a2a82fa0d6ad725144c5380fd0df7b (diff) |
fix even more warnings reported by phpstan
Diffstat (limited to 'classes/api.php')
-rwxr-xr-x | classes/api.php | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/classes/api.php b/classes/api.php index 802a7ae96..7125e52aa 100755 --- a/classes/api.php +++ b/classes/api.php @@ -174,7 +174,7 @@ class API extends Handler { $unread = getFeedUnread($cat_id, true); if ($unread || !$unread_only) { - array_push($cats, array("id" => (int) $cat_id, + array_push($cats, array("id" => $cat_id, "title" => Feeds::getCategoryTitle($cat_id), "unread" => (int) $unread)); } @@ -243,6 +243,7 @@ class API extends Handler { $field = ""; $set_to = ""; + $additional_fields = ""; switch ($field_raw) { case 0: @@ -842,14 +843,8 @@ class API extends Handler { $_REQUEST['mode'] = 2; $_REQUEST['force_show_empty'] = $include_empty; - if ($pf){ - $data = $pf->makefeedtree(); - $this->wrap(self::STATUS_OK, array("categories" => $data)); - } else { - $this->wrap(self::STATUS_ERR, array("error" => - 'UNABLE_TO_INSTANTIATE_OBJECT')); - } - + $this->wrap(self::STATUS_OK, + array("categories" => $pf->makefeedtree())); } // only works for labels or uncategorized for the time being |