r74535 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74534‎ | r74535 | r74536 >
Date:00:01, 9 October 2010
Author:reedy
Status:ok
Tags:
Comment:
Comment return types, some explicit class variable declaration
Modified paths:
  • /trunk/phase3/includes/RecentChange.php (modified) (history)
  • /trunk/phase3/includes/api/ApiDelete.php (modified) (history)
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/RecentChange.php
@@ -256,7 +256,7 @@
257257 *
258258 * @param $change Mixed: RecentChange or corresponding rc_id
259259 * @param $auto Boolean: for automatic patrol
260 - * @return See doMarkPatrolled(), or null if $change is not an existing rc_id
 260+ * @return Array See doMarkPatrolled(), or null if $change is not an existing rc_id
261261 */
262262 public static function markPatrolled( $change, $auto = false ) {
263263 $change = $change instanceof RecentChange
Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -44,6 +44,9 @@
4545 private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
4646 $fld_flags = false, $fld_timestamp = false, $fld_title = false, $fld_ids = false,
4747 $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false, $fld_tags = false;
 48+
 49+ private $tokenFunctions;
 50+
4851 /**
4952 * Get an array mapping token names to their handler functions.
5053 * The prototype for a token function is func($pageid, $title, $rc)
Index: trunk/phase3/includes/api/ApiDelete.php
@@ -158,6 +158,15 @@
159159 return array( array( 'cannotdelete', $article->mTitle->getPrefixedText() ) );
160160 }
161161
 162+ /**
 163+ * @static
 164+ * @param $token
 165+ * @param $title
 166+ * @param $oldimage
 167+ * @param $reason
 168+ * @param $suppress bool
 169+ * @return \type|array|Title
 170+ */
162171 public static function deleteFile( $token, &$title, $oldimage, &$reason = null, $suppress = false ) {
163172 $errors = self::getPermissionsError( $title, $token );
164173 if ( count( $errors ) ) {
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -180,6 +180,15 @@
181181 $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' );
182182 }
183183
 184+ /**
 185+ * @static
 186+ * @param $result ApiResult
 187+ * @param $vals
 188+ * @param $params
 189+ * @param $type
 190+ * @param $ts
 191+ * @return array
 192+ */
184193 public static function addLogParams( $result, &$vals, $params, $type, $ts ) {
185194 $params = explode( "\n", $params );
186195 switch ( $type ) {
Index: trunk/phase3/includes/api/ApiMain.php
@@ -448,7 +448,7 @@
449449 /**
450450 * Replace the result data with the information about an exception.
451451 * Returns the error code
452 - * @param $e MWException
 452+ * @param $e Exception
453453 */
454454 protected function substituteResultWithError( $e ) {
455455 // Printer may not be initialized if the extractRequestParams() fails for the main module
Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -41,6 +41,8 @@
4242 $fld_readable = false, $fld_watched = false,
4343 $fld_preload = false, $fld_displaytitle = false;
4444
 45+ private $tokenFunctions;
 46+
4547 public function __construct( $query, $moduleName ) {
4648 parent::__construct( $query, $moduleName, 'in' );
4749 }

Status & tagging log