Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | |
116 | 116 | # Cleared with clearState(): |
117 | 117 | /** |
118 | | - * @var OutputPage |
| 118 | + * @var ParserOutput |
119 | 119 | */ |
120 | 120 | var $mOutput; |
121 | 121 | var $mAutonumber, $mDTopen; |
— | — | @@ -988,7 +988,6 @@ |
989 | 989 | return $out; |
990 | 990 | } |
991 | 991 | |
992 | | - |
993 | 992 | /** |
994 | 993 | * Helper function for doTableStuff() separating the contents of cells from |
995 | 994 | * attributes. Particularly useful as there's a possible bug and this action |
— | — | @@ -1620,7 +1619,6 @@ |
1621 | 1620 | return $attribs; |
1622 | 1621 | } |
1623 | 1622 | |
1624 | | - |
1625 | 1623 | /** |
1626 | 1624 | * Replace unusual URL escape codes with their equivalent characters |
1627 | 1625 | * |
— | — | @@ -2127,6 +2125,8 @@ |
2128 | 2126 | /**#@+ |
2129 | 2127 | * Used by doBlockLevels() |
2130 | 2128 | * @private |
| 2129 | + * |
| 2130 | + * @return string |
2131 | 2131 | */ |
2132 | 2132 | function closeParagraph() { |
2133 | 2133 | $result = ''; |
— | — | @@ -2162,6 +2162,8 @@ |
2163 | 2163 | * These next three functions open, continue, and close the list |
2164 | 2164 | * element appropriate to the prefix character passed into them. |
2165 | 2165 | * @private |
| 2166 | + * |
| 2167 | + * @return string |
2166 | 2168 | */ |
2167 | 2169 | function openList( $char ) { |
2168 | 2170 | $result = $this->closeParagraph(); |
— | — | @@ -2186,6 +2188,8 @@ |
2187 | 2189 | * TODO: document |
2188 | 2190 | * @param $char String |
2189 | 2191 | * @private |
| 2192 | + * |
| 2193 | + * @return string |
2190 | 2194 | */ |
2191 | 2195 | function nextItem( $char ) { |
2192 | 2196 | if ( '*' === $char || '#' === $char ) { |
— | — | @@ -2210,6 +2214,8 @@ |
2211 | 2215 | * TODO: document |
2212 | 2216 | * @param $char String |
2213 | 2217 | * @private |
| 2218 | + * |
| 2219 | + * @return string |
2214 | 2220 | */ |
2215 | 2221 | function closeList( $char ) { |
2216 | 2222 | if ( '*' === $char ) { |
— | — | @@ -2585,6 +2591,9 @@ |
2586 | 2592 | * Return value of a magic variable (like PAGENAME) |
2587 | 2593 | * |
2588 | 2594 | * @private |
| 2595 | + * |
| 2596 | + * @param $index integer |
| 2597 | + * @param $frame PPFrame |
2589 | 2598 | */ |
2590 | 2599 | function getVariableValue( $index, $frame=false ) { |
2591 | 2600 | global $wgContLang, $wgSitename, $wgServer; |
— | — | @@ -2933,6 +2942,8 @@ |
2934 | 2943 | * dependency requirements. |
2935 | 2944 | * |
2936 | 2945 | * @private |
| 2946 | + * |
| 2947 | + * @return PPNode |
2937 | 2948 | */ |
2938 | 2949 | function preprocessToDom( $text, $flags = 0 ) { |
2939 | 2950 | $dom = $this->getPreprocessor()->preprocessToObj( $text, $flags ); |
— | — | @@ -2941,6 +2952,8 @@ |
2942 | 2953 | |
2943 | 2954 | /** |
2944 | 2955 | * Return a three-element array: leading whitespace, string contents, trailing whitespace |
| 2956 | + * |
| 2957 | + * @return array |
2945 | 2958 | */ |
2946 | 2959 | public static function splitWhitespace( $s ) { |
2947 | 2960 | $ltrimmed = ltrim( $s ); |
— | — | @@ -2971,6 +2984,8 @@ |
2972 | 2985 | * Providing arguments this way may be useful for extensions wishing to perform variable replacement explicitly. |
2973 | 2986 | * @param $argsOnly Boolean: only do argument (triple-brace) expansion, not double-brace expansion |
2974 | 2987 | * @private |
| 2988 | + * |
| 2989 | + * @return string |
2975 | 2990 | */ |
2976 | 2991 | function replaceVariables( $text, $frame = false, $argsOnly = false ) { |
2977 | 2992 | # Is there any text? Also, Prevent too big inclusions! |
— | — | @@ -2994,7 +3009,11 @@ |
2995 | 3010 | return $text; |
2996 | 3011 | } |
2997 | 3012 | |
2998 | | - # Clean up argument array - refactored in 1.9 so parserfunctions can use it, too. |
| 3013 | + /** |
| 3014 | + * Clean up argument array - refactored in 1.9 so parserfunctions can use it, too. |
| 3015 | + * |
| 3016 | + * @return array |
| 3017 | + */ |
2999 | 3018 | static function createAssocArgs( $args ) { |
3000 | 3019 | $assocArgs = array(); |
3001 | 3020 | $index = 1; |
— | — | @@ -3376,6 +3395,8 @@ |
3377 | 3396 | /** |
3378 | 3397 | * Get the semi-parsed DOM representation of a template with a given title, |
3379 | 3398 | * and its redirect destination title. Cached. |
| 3399 | + * |
| 3400 | + * @return array |
3380 | 3401 | */ |
3381 | 3402 | function getTemplateDom( $title ) { |
3382 | 3403 | $cacheTitle = $title; |
— | — | @@ -3440,8 +3461,10 @@ |
3441 | 3462 | /** |
3442 | 3463 | * Static function to get a template |
3443 | 3464 | * Can be overridden via ParserOptions::setTemplateCallback(). |
| 3465 | + * |
| 3466 | + * @return array |
3444 | 3467 | */ |
3445 | | - static function statelessFetchTemplate( $title, $parser=false ) { |
| 3468 | + static function statelessFetchTemplate( $title, $parser = false ) { |
3446 | 3469 | $text = $skip = false; |
3447 | 3470 | $finalTitle = $title; |
3448 | 3471 | $deps = array(); |
— | — | @@ -3553,6 +3576,8 @@ |
3554 | 3577 | |
3555 | 3578 | /** |
3556 | 3579 | * Transclude an interwiki link. |
| 3580 | + * |
| 3581 | + * @return string |
3557 | 3582 | */ |
3558 | 3583 | function interwikiTransclude( $title, $action ) { |
3559 | 3584 | global $wgEnableScaryTranscluding; |
— | — | @@ -3569,6 +3594,10 @@ |
3570 | 3595 | return $this->fetchScaryTemplateMaybeFromCache( $url ); |
3571 | 3596 | } |
3572 | 3597 | |
| 3598 | + /** |
| 3599 | + * @param $url string |
| 3600 | + * @return Mixed|String |
| 3601 | + */ |
3573 | 3602 | function fetchScaryTemplateMaybeFromCache( $url ) { |
3574 | 3603 | global $wgTranscludeCacheExpiry; |
3575 | 3604 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -3593,10 +3622,14 @@ |
3594 | 3623 | return $text; |
3595 | 3624 | } |
3596 | 3625 | |
3597 | | - |
3598 | 3626 | /** |
3599 | 3627 | * Triple brace replacement -- used for template arguments |
3600 | 3628 | * @private |
| 3629 | + * |
| 3630 | + * @param $peice array |
| 3631 | + * @param $frame PPFrame |
| 3632 | + * |
| 3633 | + * @return array |
3601 | 3634 | */ |
3602 | 3635 | function argSubstitution( $piece, $frame ) { |
3603 | 3636 | wfProfileIn( __METHOD__ ); |
— | — | @@ -3650,6 +3683,8 @@ |
3651 | 3684 | * inner Contents of extension element |
3652 | 3685 | * noClose Original text did not have a close tag |
3653 | 3686 | * @param $frame PPFrame |
| 3687 | + * |
| 3688 | + * @return string |
3654 | 3689 | */ |
3655 | 3690 | function extensionSubstitution( $params, $frame ) { |
3656 | 3691 | $name = $frame->expand( $params['name'] ); |
— | — | @@ -5236,10 +5271,10 @@ |
5237 | 5272 | * This function returns $oldtext after the content of the section |
5238 | 5273 | * specified by $section has been replaced with $text. |
5239 | 5274 | * |
5240 | | - * @param $text String: former text of the article |
| 5275 | + * @param $oldtext String: former text of the article |
5241 | 5276 | * @param $section Numeric: section identifier |
5242 | 5277 | * @param $text String: replacing text |
5243 | | - * #return String: modified text |
| 5278 | + * @return String: modified text |
5244 | 5279 | */ |
5245 | 5280 | public function replaceSection( $oldtext, $section, $text ) { |
5246 | 5281 | return $this->extractSections( $oldtext, $section, "replace", $text ); |
— | — | @@ -5257,7 +5292,7 @@ |
5258 | 5293 | /** |
5259 | 5294 | * Get the revision object for $this->mRevisionId |
5260 | 5295 | * |
5261 | | - * @return either a Revision object or null |
| 5296 | + * @return Revision|null either a Revision object or null |
5262 | 5297 | */ |
5263 | 5298 | protected function getRevisionObject() { |
5264 | 5299 | if ( !is_null( $this->mRevisionObject ) ) { |
— | — | @@ -5418,6 +5453,8 @@ |
5419 | 5454 | |
5420 | 5455 | /** |
5421 | 5456 | * strip/replaceVariables/unstrip for preprocessor regression testing |
| 5457 | + * |
| 5458 | + * @return string |
5422 | 5459 | */ |
5423 | 5460 | function testSrvus( $text, $title, ParserOptions $options, $outputType = self::OT_HTML ) { |
5424 | 5461 | if ( !$title instanceof Title ) { |
— | — | @@ -5456,6 +5493,8 @@ |
5457 | 5494 | * This will call the callback function twice, with 'aaa' and 'bbb'. Those |
5458 | 5495 | * two strings will be replaced with the value returned by the callback in |
5459 | 5496 | * each case. |
| 5497 | + * |
| 5498 | + * @return string |
5460 | 5499 | */ |
5461 | 5500 | function markerSkipCallback( $s, $callback ) { |
5462 | 5501 | $i = 0; |
— | — | @@ -5492,6 +5531,8 @@ |
5493 | 5532 | * array can later be loaded into another parser instance with |
5494 | 5533 | * unserializeHalfParsedText(). The text can then be safely incorporated into |
5495 | 5534 | * the return value of a parser hook. |
| 5535 | + * |
| 5536 | + * @return array |
5496 | 5537 | */ |
5497 | 5538 | function serializeHalfParsedText( $text ) { |
5498 | 5539 | wfProfileIn( __METHOD__ ); |
— | — | @@ -5540,7 +5581,9 @@ |
5541 | 5582 | * serializeHalfParsedText(), is compatible with the current version of the |
5542 | 5583 | * parser. |
5543 | 5584 | * |
5544 | | - * @param $data Array. |
| 5585 | + * @param $data Array |
| 5586 | + * |
| 5587 | + * @return bool |
5545 | 5588 | */ |
5546 | 5589 | function isValidHalfParsedText( $data ) { |
5547 | 5590 | return isset( $data['version'] ) && $data['version'] == self::HALF_PARSED_VERSION; |
Index: trunk/phase3/includes/parser/Preprocessor.php |
— | — | @@ -12,16 +12,28 @@ |
13 | 13 | /** Create a new preprocessor object based on an initialised Parser object */ |
14 | 14 | function __construct( $parser ); |
15 | 15 | |
16 | | - /** Create a new top-level frame for expansion of a page */ |
| 16 | + /** |
| 17 | + * Create a new top-level frame for expansion of a page |
| 18 | + * |
| 19 | + * @return PPFrame |
| 20 | + */ |
17 | 21 | function newFrame(); |
18 | 22 | |
19 | | - /** Create a new custom frame for programmatic use of parameter replacement as used in some extensions */ |
| 23 | + /** |
| 24 | + * Create a new custom frame for programmatic use of parameter replacement as used in some extensions |
| 25 | + * |
| 26 | + * @return PPFrame |
| 27 | + */ |
20 | 28 | function newCustomFrame( $args ); |
21 | 29 | |
22 | 30 | /** Create a new custom node for programmatic use of parameter replacement as used in some extensions */ |
23 | 31 | function newPartNodeArray( $values ); |
24 | 32 | |
25 | | - /** Preprocess text to a PPNode */ |
| 33 | + /** |
| 34 | + * Preprocess text to a PPNode |
| 35 | + * |
| 36 | + * @return PPNode |
| 37 | + */ |
26 | 38 | function preprocessToObj( $text, $flags = 0 ); |
27 | 39 | } |
28 | 40 | |
— | — | @@ -126,6 +138,8 @@ |
127 | 139 | |
128 | 140 | /** |
129 | 141 | * Get the first child of a tree node. False if there isn't one. |
| 142 | + * |
| 143 | + * @return PPNode |
130 | 144 | */ |
131 | 145 | function getFirstChild(); |
132 | 146 | |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -264,6 +264,7 @@ |
265 | 265 | * Create an Article object of the appropriate class for the given page. |
266 | 266 | * |
267 | 267 | * @param $title Title |
| 268 | + * @param $context RequestContext |
268 | 269 | * @return Article object |
269 | 270 | */ |
270 | 271 | public static function articleFromTitle( &$title, RequestContext &$context ) { |