From e3ab6fc5cbab1aaf365e73abaa3d91c03eebdd47 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sat, 28 Jul 2012 11:06:10 +0200 Subject: Fixed and extended PHPDoc comments and added additional @var comments --- lib/plugins/syntax.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'lib/plugins/syntax.php') diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php index 12451f636..d4394eb6f 100644 --- a/lib/plugins/syntax.php +++ b/lib/plugins/syntax.php @@ -86,7 +86,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { * @param $match string The text matched by the patterns * @param $state int The lexer state for the match * @param $pos int The character position of the matched text - * @param $handler ref Reference to the Doku_Handler object + * @param $handler Doku_Handler Reference to the Doku_Handler object * @return array Return an array with all data you want to use in render */ function handle($match, $state, $pos, &$handler){ @@ -111,10 +111,10 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { * The contents of the $data array depends on what the handler() function above * created * - * @param $format string output format being rendered - * @param $renderer ref reference to the current renderer object - * @param $data array data created by handler() - * @return boolean rendered correctly? + * @param $format string output format being rendered + * @param $renderer Doku_Renderer reference to the current renderer object + * @param $data array data created by handler() + * @return boolean rendered correctly? */ function render($format, &$renderer, $data) { trigger_error('render() not implemented in '.get_class($this), E_USER_WARNING); @@ -148,6 +148,12 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { // extract from class name, format = _plugin_[_] function getPluginType() { list($t) = explode('_', get_class($this), 2); return $t; } function getPluginName() { list($t, $p, $n) = explode('_', get_class($this), 4); return $n; } + + /** + * Get the name of the component of the current class + * + * @return string component name + */ function getPluginComponent() { list($t, $p, $n, $c) = explode('_', get_class($this), 4); return (isset($c)?$c:''); } // localisation methods @@ -158,7 +164,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { * to try to minimise unnecessary loading of the strings when the plugin doesn't require them * e.g. when info plugin is querying plugins for information about themselves. * - * @param $id id of the string to be retrieved + * @param string $id id of the string to be retrieved * @return string string in appropriate language or english if not available */ function getLang($id) { @@ -173,7 +179,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { * retrieve a language dependent wiki page and pass to xhtml renderer for display * plugin equivalent of p_locale_xhtml() * - * @param $id id of language dependent wiki page + * @param string $id id of language dependent wiki page * @return string parsed contents of the wiki page in xhtml format */ function locale_xhtml($id) { -- cgit v1.2.3