r86123 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86122‎ | r86123 | r86124 >
Date:17:44, 15 April 2011
Author:reedy
Status:ok
Tags:
Comment:
More function documentation
Modified paths:
  • /trunk/extensions/ParserFunctions/ParserFunctions_body.php (modified) (history)
  • /trunk/phase3/includes/Collation.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php
@@ -204,6 +204,13 @@
205205 }
206206 }
207207
 208+ /**
 209+ * @static
 210+ * @param $parser Parser
 211+ * @param $frame PPFrame
 212+ * @param $args
 213+ * @return string
 214+ */
208215 public static function switchObj( $parser, $frame, $args ) {
209216 if ( count( $args ) == 0 ) {
210217 return '';
@@ -263,6 +270,8 @@
264271 *
265272 * Following subpage link syntax instead of standard path syntax, an
266273 * initial slash is treated as a relative path, and vice versa.
 274+ *
 275+ * @param $parser Parser
267276 */
268277 public static function rel2abs( $parser , $to = '' , $from = '' ) {
269278
@@ -318,6 +327,12 @@
319328 return implode( '/' , $newExploded );
320329 }
321330
 331+ /**
 332+ * @static
 333+ * @param $parser Parser
 334+ * @param $frame PPFrame
 335+ * @return bool
 336+ */
322337 public static function incrementIfexistCount( $parser, $frame ) {
323338 // Don't let this be called more than a certain number of times. It tends to make the database explode.
324339 global $wgExpensiveParserFunctionLimit;
Index: trunk/phase3/includes/Collation.php
@@ -3,6 +3,10 @@
44 abstract class Collation {
55 static $instance;
66
 7+ /**
 8+ * @static
 9+ * @return Collation
 10+ */
711 static function singleton() {
812 if ( !self::$instance ) {
913 global $wgCategoryCollation;
@@ -11,6 +15,12 @@
1216 return self::$instance;
1317 }
1418
 19+ /**
 20+ * @static
 21+ * @throws MWException
 22+ * @param $collationName string
 23+ * @return Collation
 24+ */
1525 static function factory( $collationName ) {
1626 switch( $collationName ) {
1727 case 'uppercase':
@@ -259,13 +269,13 @@
260270 * Do a binary search, and return the index of the largest item that sorts
261271 * less than or equal to the target value.
262272 *
263 - * @param $valueCallback A function to call to get the value with
 273+ * @param $valueCallback array A function to call to get the value with
264274 * a given array index.
265 - * @param $valueCount The number of items accessible via $valueCallback,
 275+ * @param $valueCount int The number of items accessible via $valueCallback,
266276 * indexed from 0 to $valueCount - 1
267 - * @param $comparisonCallback A callback to compare two values, returning
 277+ * @param $comparisonCallback array A callback to compare two values, returning
268278 * -1, 0 or 1 in the style of strcmp().
269 - * @param $target The target value to find.
 279+ * @param $target string The target value to find.
270280 *
271281 * @return The item index of the lower bound, or false if the target value
272282 * sorts before all items.

Status & tagging log