summaryrefslogtreecommitdiff
path: root/classes/plugin.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-11-14 16:49:10 +0300
committerAndrew Dolgov <[email protected]>2021-11-14 16:49:10 +0300
commitaf2f4460ce94f48aa4c3bb3176c59325b6612b32 (patch)
tree7d49a2d9ac31ec6493b60a2bb4a957d38164cc48 /classes/plugin.php
parentc3ffa08807df4a83cd476aca79fc96217acc6c3a (diff)
* deal with some phpstan warnings in base plugin class
* arguably better hack for incompatible plugins causing E_COMPILE_ERROR
Diffstat (limited to 'classes/plugin.php')
-rw-r--r--classes/plugin.php94
1 files changed, 94 insertions, 0 deletions
diff --git a/classes/plugin.php b/classes/plugin.php
index 8c14cd78d..b027a05c3 100644
--- a/classes/plugin.php
+++ b/classes/plugin.php
@@ -140,10 +140,19 @@ abstract class Plugin {
user_error("Dummy method invoked.", E_USER_ERROR);
}
+ /**
+ * @param FeedParser $parser
+ * @param int $feed_id
+ * @return void
+ */
function hook_feed_parsed($parser, $feed_id) {
user_error("Dummy method invoked.", E_USER_ERROR);
}
+ /**
+ * @param array<string,string> $cli_options
+ * @return void
+ */
function hook_update_task($cli_options) {
user_error("Dummy method invoked.", E_USER_ERROR);
}
@@ -170,44 +179,94 @@ abstract class Plugin {
return false;
}
+ /**
+ * @param array<string, string> $hotkeys
+ * @return array<string, string>
+ */
function hook_hotkey_map($hotkeys) {
user_error("Dummy method invoked.", E_USER_ERROR);
}
+ /**
+ * @param array<string, mixed> $article
+ * @return array<string, mixed>
+ */
function hook_render_article($article) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return [];
}
+ /**
+ * @param array<string, mixed> $article
+ * @return array<string, mixed>
+ */
function hook_render_article_cdm($article) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return [];
}
+ /**
+ * @param string $feed_data
+ * @param string $fetch_url
+ * @param int $owner_uid
+ * @param int $feed
+ * @return string
+ */
function hook_feed_fetched($feed_data, $fetch_url, $owner_uid, $feed) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return "";
}
function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes, $article_id) {
user_error("Dummy method invoked.", E_USER_ERROR);
}
+ /**
+ * @param array{'article': array<string,mixed>} $params
+ * @return array<string, string>
+ */
function hook_render_article_api($params) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return [];
}
+ /** @return string */
function hook_toolbar_button() {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return "";
}
+ /** @return string */
function hook_action_item() {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return "";
}
+ /**
+ * @param int $feed_id
+ * @param bool $is_cat
+ * @return string
+ */
function hook_headline_toolbar_button($feed_id, $is_cat) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return "";
}
+ /**
+ * @param array<string,string> $hotkeys
+ * @return array<string,string>
+ */
function hook_hotkey_info($hotkeys) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return [];
}
function hook_article_left_button($row) {
@@ -230,6 +289,7 @@ abstract class Plugin {
user_error("Dummy method invoked.", E_USER_ERROR);
}
+ /** @return void */
function hook_house_keeping() {
user_error("Dummy method invoked.", E_USER_ERROR);
}
@@ -262,6 +322,7 @@ abstract class Plugin {
user_error("Dummy method invoked.", E_USER_ERROR);
}
+ /** @return void */
function hook_main_toolbar_button() {
user_error("Dummy method invoked.", E_USER_ERROR);
}
@@ -296,24 +357,57 @@ abstract class Plugin {
user_error("Dummy method invoked.", E_USER_ERROR);
}
+ /** NOTE: $article_filters should be renamed $filter_actions because that's what this is
+ * @param int $feed_id
+ * @param int $owner_uid
+ * @param array<string,mixed> $article
+ * @param array<string,mixed> $matched_filters
+ * @param array<string,string|bool|int> $matched_rules
+ * @param array<string,string> $article_filters
+ * @return void
+ */
function hook_filter_triggered($feed_id, $owner_uid, $article, $matched_filters, $matched_rules, $article_filters) {
user_error("Dummy method invoked.", E_USER_ERROR);
}
+ /**
+ * @param string $url
+ * @return string
+ */
function hook_get_full_text($url) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return "";
}
+ /**
+ * @param array<string,string> $enclosures
+ * @param string $content
+ * @param string $site_url
+ * @param array<string,mixed> $article
+ * @return string
+ */
function hook_article_image($enclosures, $content, $site_url, $article) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return "";
}
+ /** @return string */
function hook_feed_tree() {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return "";
}
+ /**
+ * @param string $url
+ * @return bool
+ */
function hook_iframe_whitelisted($url) {
user_error("Dummy method invoked.", E_USER_ERROR);
+
+ return false;
}
function hook_enclosure_imported($enclosure, $feed) {