diff options
author | Andrew Dolgov <[email protected]> | 2021-11-13 19:41:50 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-11-13 19:41:50 +0300 |
commit | 37827427a22d2e379c1142e2eb3d46c53e43783b (patch) | |
tree | c67bb935363dcd250b6fbf2d0293f5212019ce9b | |
parent | 9845d5fd15c8e123f31f39574d2b48437a3e0586 (diff) |
rework previous Plugin changes as phpdoc annotations
-rw-r--r-- | classes/plugin.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/classes/plugin.php b/classes/plugin.php index 5d6d4d39e..5b486d766 100644 --- a/classes/plugin.php +++ b/classes/plugin.php @@ -5,6 +5,11 @@ abstract class Plugin { /** @var PDO $pdo */ protected $pdo; + /** + * @param PluginHost $host + * + * @return void + * */ abstract function init($host); /** @return array<float|string|bool> */ @@ -23,38 +28,60 @@ abstract class Plugin { return array(); } + /** + * @param string $method + * + * @return bool */ function is_public_method($method) { return false; } + /** + * @param string $method + * + * @return bool */ function csrf_ignore($method) { return false; } + /** @return string */ function get_js() { return ""; } + /** @return string */ function get_prefs_js() { return ""; } + /** @return int */ function api_version() { return Plugin::API_VERSION_COMPAT; } /* gettext-related helpers */ + /** + * @param string $msgid + * + * @return string */ function __($msgid) { /** @var Plugin $this -- this is a strictly template-related hack */ return _dgettext(PluginHost::object_to_domain($this), $msgid); } + /** + * @param string $singular + * @param string $plural + * @param int $number + * + * @return string */ function _ngettext($singular, $plural, $number) { /** @var Plugin $this -- this is a strictly template-related hack */ return _dngettext(PluginHost::object_to_domain($this), $singular, $plural, $number); } + /** @return string */ function T_sprintf() { $args = func_get_args(); $msgid = array_shift($args); |