From fe5ada72504705f9304c3f0bba049a20998fe650 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Nov 2021 20:07:13 +0300 Subject: [PATCH] set some annotations on Plugin hook methods --- classes/plugin.php | 17 +++++++++++++++++ plugins/share/init.php | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/classes/plugin.php b/classes/plugin.php index feae9ec9c..638cc2f50 100644 --- a/classes/plugin.php +++ b/classes/plugin.php @@ -96,22 +96,39 @@ abstract class Plugin { /* plugin hook methods */ + /** + * @param array $line + * @return string + */ function hook_article_button($line) { user_error("Dummy method invoked.", E_USER_ERROR); } + /** + * @param array $article + * @return array + */ function hook_article_filter($article) { user_error("Dummy method invoked.", E_USER_ERROR); } + /** + * @param string $tab + * @return void + */ function hook_prefs_tab($tab) { user_error("Dummy method invoked.", E_USER_ERROR); } + /** + * @param string $section + * @return void + */ function hook_prefs_tab_section($section) { user_error("Dummy method invoked.", E_USER_ERROR); } + /** @return void */ function hook_prefs_tabs() { user_error("Dummy method invoked.", E_USER_ERROR); } diff --git a/plugins/share/init.php b/plugins/share/init.php index 4dbc389fd..b900de5c0 100644 --- a/plugins/share/init.php +++ b/plugins/share/init.php @@ -43,8 +43,8 @@ class Share extends Plugin { print __("Article unshared"); } - /** @param int $id - * + /** + * @param string $id * @return void */ function hook_prefs_tab_section($id) { if ($id == "prefFeedsPublishedGenerated") {