From 01b39d985c9f194a35c690a18149cbb06fc7b0d3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov <noreply@fakecake.org> Date: Sun, 14 Nov 2021 18:00:03 +0300 Subject: [PATCH] deal with the rest of warnings in plugin.php --- classes/plugin.php | 55 ++++++++++++++++++++++++++++++++++++++ plugins/af_comics/init.php | 1 + 2 files changed, 56 insertions(+) diff --git a/classes/plugin.php b/classes/plugin.php index ac234f081..b20bbcbc2 100644 --- a/classes/plugin.php +++ b/classes/plugin.php @@ -457,16 +457,40 @@ abstract class Plugin { return ""; } + /** + * @param array{"title": string, "site_url": string} $basic_info + * @param string $fetch_url + * @param int $owner_uid + * @param int $feed_id + * @param string $auth_login + * @param string $auth_pass + * @return array{"title": string, "site_url": string} + */ function hook_feed_basic_info($basic_info, $fetch_url, $owner_uid, $feed_id, $auth_login, $auth_pass) { user_error("Dummy method invoked.", E_USER_ERROR); + + return $basic_info; } + /** + * @param string $filename + * @return bool + */ function hook_send_local_file($filename) { user_error("Dummy method invoked.", E_USER_ERROR); + + return false; } + /** + * @param int $feed_id + * @param int $owner_uid + * @return bool + */ function hook_unsubscribe_feed($feed_id, $owner_uid) { user_error("Dummy method invoked.", E_USER_ERROR); + + return false; } /** @@ -533,23 +557,54 @@ abstract class Plugin { return false; } + /** + * @param array<string,string> $enclosure + * @param int $feed + * @return array<string,string> ($enclosure) + */ function hook_enclosure_imported($enclosure, $feed) { user_error("Dummy method invoked.", E_USER_ERROR); + + return $enclosure; } + /** @return array<string,string> */ function hook_headlines_custom_sort_map() { user_error("Dummy method invoked.", E_USER_ERROR); + + return ["" => ""]; } + /** + * @param string $order + * @return array<int, string|bool> -- query, skip_first_id + */ function hook_headlines_custom_sort_override($order) { user_error("Dummy method invoked.", E_USER_ERROR); + + return ["", false]; } + /** + * @param int $feed_id + * @param int $is_cat + * @return string + */ function hook_headline_toolbar_select_menu_item($feed_id, $is_cat) { user_error("Dummy method invoked.", E_USER_ERROR); + + return ""; } + /** + * @param string $url + * @param string $auth_login + * @param string $auth_pass + * @return bool + */ function hook_pre_subscribe(&$url, $auth_login, $auth_pass) { user_error("Dummy method invoked.", E_USER_ERROR); + + return false; } } diff --git a/plugins/af_comics/init.php b/plugins/af_comics/init.php index 84d95a2ba..a9a8f3faa 100755 --- a/plugins/af_comics/init.php +++ b/plugins/af_comics/init.php @@ -1,6 +1,7 @@ <?php class Af_Comics extends Plugin { + /** @var array<object> $filters */ private $filters = array(); function about() { -- GitLab