From da3b3fbae43e8e710695dccfc4856751ae21535f Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 8 Feb 2011 23:18:13 +0000 Subject: [PATCH] More return type documentation --- includes/MagicWord.php | 1 + includes/parser/CoreParserFunctions.php | 18 ++++++++++++++++++ includes/parser/CoreTagHooks.php | 12 ++++++++++++ includes/parser/LinkHolderArray.php | 1 + includes/parser/Parser_DiffTest.php | 4 ++++ 5 files changed, 36 insertions(+) diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 4698960b57..9988232f5c 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -192,6 +192,7 @@ class MagicWord { /** * Factory: creates an object representing an ID * @static + * @return MagicWord */ static function &get( $id ) { wfProfileIn( __METHOD__ ); diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 88349b6412..d1ebc1553c 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -10,6 +10,11 @@ * @ingroup Parser */ class CoreParserFunctions { + /** + * @static + * @param $parser Parser + * @return void + */ static function register( $parser ) { global $wgAllowDisplayTitle, $wgAllowSlowParserFunctions; @@ -507,6 +512,7 @@ class CoreParserFunctions { * to the link cache, so the local cache here should be unnecessary, but * in fact calling getLength() repeatedly for the same $page does seem to * run one query for each call? + * @param $parser Parser */ static function pagesize( $parser, $page = '', $raw = null ) { static $cache = array(); @@ -584,6 +590,12 @@ class CoreParserFunctions { return self::pad( $string, $length, $padding ); } + /** + * @static + * @param $parser Parser + * @param $text + * @return string + */ static function anchorencode( $parser, $text ) { return substr( $parser->guessSectionNameFromWikiText( $text ), 1); } @@ -598,6 +610,12 @@ class CoreParserFunctions { } } + /** + * @static + * @param $parser Parser + * @param $text + * @return string + */ public static function defaultsort( $parser, $text ) { $text = trim( $text ); if( strlen( $text ) == 0 ) diff --git a/includes/parser/CoreTagHooks.php b/includes/parser/CoreTagHooks.php index 33f3c824e5..5718b06f51 100644 --- a/includes/parser/CoreTagHooks.php +++ b/includes/parser/CoreTagHooks.php @@ -10,6 +10,11 @@ * @ingroup Parser */ class CoreTagHooks { + /** + * @static + * @param $parser Parser + * @return void + */ static function register( $parser ) { global $wgRawHtml, $wgUseTeX; $parser->setHook( 'pre', array( __CLASS__, 'pre' ) ); @@ -52,6 +57,13 @@ class CoreTagHooks { return $wgContLang->armourMath( MathRenderer::renderMath( $content, $attributes, $parser->getOptions() ) ); } + /** + * @static + * @param $content + * @param $attributes + * @param $parser Parser + * @return + */ static function gallery( $content, $attributes, $parser ) { return $parser->renderImageGallery( $content, $attributes ); } diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index 133655e707..3ad417b751 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -28,6 +28,7 @@ class LinkHolderArray { /** * Merge another LinkHolderArray into this one + * @param $other LinkHolderArray */ function merge( $other ) { foreach ( $other->internals as $ns => $entries ) { diff --git a/includes/parser/Parser_DiffTest.php b/includes/parser/Parser_DiffTest.php index c6dd76e52b..efad33f91d 100644 --- a/includes/parser/Parser_DiffTest.php +++ b/includes/parser/Parser_DiffTest.php @@ -111,6 +111,10 @@ class Parser_DiffTest } } + /** + * @param $parser Parser + * @return bool + */ function onClearState( &$parser ) { // hack marker prefixes to get identical output if ( !isset( $this->dtUniqPrefix ) ) { -- 2.20.1