From 4a0c3d8ff585a054bbdb9525f5b834ccda0ff447 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 9 Oct 2010 00:01:45 +0000 Subject: [PATCH] Comment return types, some explicit class variable declaration --- includes/RecentChange.php | 2 +- includes/api/ApiDelete.php | 9 +++++++++ includes/api/ApiMain.php | 2 +- includes/api/ApiQueryInfo.php | 2 ++ includes/api/ApiQueryLogEvents.php | 9 +++++++++ includes/api/ApiQueryRecentChanges.php | 3 +++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 333ff02577..bf8379c4af 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -256,7 +256,7 @@ class RecentChange { * * @param $change Mixed: RecentChange or corresponding rc_id * @param $auto Boolean: for automatic patrol - * @return See doMarkPatrolled(), or null if $change is not an existing rc_id + * @return Array See doMarkPatrolled(), or null if $change is not an existing rc_id */ public static function markPatrolled( $change, $auto = false ) { $change = $change instanceof RecentChange diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 93baa4e33a..714b35878d 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -158,6 +158,15 @@ class ApiDelete extends ApiBase { return array( array( 'cannotdelete', $article->mTitle->getPrefixedText() ) ); } + /** + * @static + * @param $token + * @param $title + * @param $oldimage + * @param $reason + * @param $suppress bool + * @return \type|array|Title + */ public static function deleteFile( $token, &$title, $oldimage, &$reason = null, $suppress = false ) { $errors = self::getPermissionsError( $title, $token ); if ( count( $errors ) ) { diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index df830ea1fd..19ad59a688 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -448,7 +448,7 @@ class ApiMain extends ApiBase { /** * Replace the result data with the information about an exception. * Returns the error code - * @param $e MWException + * @param $e Exception */ protected function substituteResultWithError( $e ) { // Printer may not be initialized if the extractRequestParams() fails for the main module diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index d6d00496af..fbef4cf75f 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -41,6 +41,8 @@ class ApiQueryInfo extends ApiQueryBase { $fld_readable = false, $fld_watched = false, $fld_preload = false, $fld_displaytitle = false; + private $tokenFunctions; + public function __construct( $query, $moduleName ) { parent::__construct( $query, $moduleName, 'in' ); } diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index ba20114725..ee6f1ebb2d 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -180,6 +180,15 @@ class ApiQueryLogEvents extends ApiQueryBase { $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' ); } + /** + * @static + * @param $result ApiResult + * @param $vals + * @param $params + * @param $type + * @param $ts + * @return array + */ public static function addLogParams( $result, &$vals, $params, $type, $ts ) { $params = explode( "\n", $params ); switch ( $type ) { diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index fe53b1a4cd..0281a04789 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -44,6 +44,9 @@ class ApiQueryRecentChanges extends ApiQueryBase { private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false, $fld_flags = false, $fld_timestamp = false, $fld_title = false, $fld_ids = false, $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false, $fld_tags = false; + + private $tokenFunctions; + /** * Get an array mapping token names to their handler functions. * The prototype for a token function is func($pageid, $title, $rc) -- 2.20.1