From: Sam Reed Date: Sat, 19 Feb 2011 00:30:18 +0000 (+0000) Subject: More parameter documentation X-Git-Tag: 1.31.0-rc.0~31910 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=fa6402516114f900194ab0203ff8878f9094bcab;p=lhc%2Fweb%2Fwiklou.git More parameter documentation --- diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 5d28174d4c..bae27bb51a 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -161,7 +161,7 @@ class ApiDelete extends ApiBase { /** * @static * @param $token - * @param $title + * @param $title Title * @param $oldimage * @param $reason * @param $suppress bool diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index e7797476bf..b9140b5c18 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -67,7 +67,6 @@ class ApiEditPage extends ApiBase { $this->getResult()->addValue( null, 'foo', $titles ); - $redirValues = array(); foreach ( $titles as $id => $newTitle ) { diff --git a/includes/api/ApiFormatRaw.php b/includes/api/ApiFormatRaw.php index b2a1da7ec4..7591287195 100644 --- a/includes/api/ApiFormatRaw.php +++ b/includes/api/ApiFormatRaw.php @@ -38,7 +38,7 @@ class ApiFormatRaw extends ApiFormatBase { /** * Constructor * @param $main ApiMain object - * @param $errorFallback Formatter object to fall back on for errors + * @param $errorFallback ApiFormatBase object to fall back on for errors */ public function __construct( $main, $errorFallback ) { parent::__construct( $main, 'raw' ); diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index d7b7d8a119..19a6d92676 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -627,7 +627,7 @@ class ApiQuery extends ApiBase { $moduleDescriptions = array(); foreach ( $moduleList as $moduleName => $moduleClass ) { - $module = new $moduleClass ( $this, $moduleName, null ); + $module = new $moduleClass( $this, $moduleName, null ); $msg = ApiMain::makeHelpMsgHeader( $module, $paramName ); $msg2 = $module->makeHelpMsg(); diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index 03745e2c3d..c733703d09 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -53,6 +53,10 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $db = $this->getDB(); $params = $this->extractRequestParams(); diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index 1c32050a7e..ab28cacb93 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -52,6 +52,10 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $db = $this->getDB(); $params = $this->extractRequestParams(); diff --git a/includes/api/ApiQueryAllimages.php b/includes/api/ApiQueryAllimages.php index 1ae3417131..e68bc917e9 100644 --- a/includes/api/ApiQueryAllimages.php +++ b/includes/api/ApiQueryAllimages.php @@ -64,6 +64,10 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { return 'public'; } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ public function executeGenerator( $resultPageSet ) { if ( $resultPageSet->isResolvingRedirects() ) { $this->dieUsage( 'Use "gaifilterredir=nonredirects" option instead of "redirects" when using allimages as a generator', 'params' ); @@ -72,6 +76,10 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $repo = $this->mRepo; if ( !$repo instanceof LocalRepo ) { diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index 8aa78f0892..b396f37e87 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -48,6 +48,10 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase { return 'public'; } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ public function executeGenerator( $resultPageSet ) { if ( $resultPageSet->isResolvingRedirects() ) { $this->dieUsage( 'Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator', 'params' ); @@ -56,6 +60,10 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $db = $this->getDB(); diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 2900b7c57e..fc3ee01ce6 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -39,7 +39,12 @@ if ( !defined( 'MEDIAWIKI' ) ) { */ class ApiQueryBacklinks extends ApiQueryGeneratorBase { - private $params, $rootTitle, $contID, $redirID, $redirect; + /** + * @var Title + */ + private $rootTitle; + + private $params, $contID, $redirID, $redirect; private $bl_ns, $bl_from, $bl_table, $bl_code, $bl_title, $bl_sort, $bl_fields, $hasNS; private $pageMap, $resultArr; @@ -103,6 +108,10 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function prepareFirstQuery( $resultPageSet = null ) { /* SELECT page_id, page_title, page_namespace, page_is_redirect * FROM pagelinks, page WHERE pl_from=page_id @@ -141,6 +150,10 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->addOption( 'STRAIGHT_JOIN' ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function prepareSecondQuery( $resultPageSet = null ) { /* SELECT page_id, page_title, page_namespace, page_is_redirect, pl_title, pl_namespace FROM pagelinks, page WHERE pl_from=page_id @@ -199,6 +212,10 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->addOption( 'USE INDEX', array( 'page' => 'PRIMARY' ) ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $this->params = $this->extractRequestParams( false ); $this->redirect = isset( $this->params['redirect'] ) && $this->params['redirect']; diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index 84ba638455..ba7e5921f1 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -52,6 +52,10 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return + */ private function run( $resultPageSet = null ) { if ( $this->getPageSet()->getGoodTitleCount() == 0 ) { return; // nothing to do diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index 0f469dd519..d245e66509 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -52,6 +52,10 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $params = $this->extractRequestParams(); diff --git a/includes/api/ApiQueryDuplicateFiles.php b/includes/api/ApiQueryDuplicateFiles.php index e1a8801d8b..52a7c7c25d 100644 --- a/includes/api/ApiQueryDuplicateFiles.php +++ b/includes/api/ApiQueryDuplicateFiles.php @@ -52,6 +52,10 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return + */ private function run( $resultPageSet = null ) { $params = $this->extractRequestParams(); $namespaces = $this->getPageSet()->getAllTitlesByNamespace(); diff --git a/includes/api/ApiQueryIWBacklinks.php b/includes/api/ApiQueryIWBacklinks.php index 3b30252fab..07cfa16e85 100644 --- a/includes/api/ApiQueryIWBacklinks.php +++ b/includes/api/ApiQueryIWBacklinks.php @@ -48,6 +48,10 @@ class ApiQueryIWBacklinks extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ public function run( $resultPageSet = null ) { $params = $this->extractRequestParams(); diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index d95836e8a8..37e216a658 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -117,8 +117,7 @@ class ApiQueryImageInfo extends ApiQueryBase { if ( ( is_null( $start ) || $img->getTimestamp() <= $start ) && ( is_null( $params['end'] ) || $img->getTimestamp() >= $params['end'] ) - ) - { + ) { $gotOne = true; $fit = $this->addPageSubItem( $pageId, @@ -352,7 +351,7 @@ class ApiQueryImageInfo extends ApiQueryBase { return $vals; } - /* + /** * * @param $metadata Array * @param $result ApiResult @@ -379,6 +378,10 @@ class ApiQueryImageInfo extends ApiQueryBase { return 'public'; } + /** + * @param $img File + * @return string + */ private function getContinueStr( $img ) { return $img->getOriginalTitle()->getText() . '|' . $img->getTimestamp(); diff --git a/includes/api/ApiQueryImages.php b/includes/api/ApiQueryImages.php index 16d770c8c4..c63f897525 100644 --- a/includes/api/ApiQueryImages.php +++ b/includes/api/ApiQueryImages.php @@ -48,6 +48,10 @@ class ApiQueryImages extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return + */ private function run( $resultPageSet = null ) { if ( $this->getPageSet()->getGoodTitleCount() == 0 ) { return; // nothing to do diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 894c13118b..86c0a58980 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -47,6 +47,10 @@ class ApiQueryInfo extends ApiQueryBase { parent::__construct( $query, $moduleName, 'in' ); } + /** + * @param $pageSet ApiPageSet + * @return void + */ public function requestExtraData( $pageSet ) { global $wgDisableCounters; diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php index 65975b23e2..64f46bc6d3 100644 --- a/includes/api/ApiQueryLinks.php +++ b/includes/api/ApiQueryLinks.php @@ -74,6 +74,10 @@ class ApiQueryLinks extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return + */ private function run( $resultPageSet = null ) { if ( $this->getPageSet()->getGoodTitleCount() == 0 ) { return; // nothing to do diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php index 9b0c3d6d0d..fcca490f23 100644 --- a/includes/api/ApiQueryProtectedTitles.php +++ b/includes/api/ApiQueryProtectedTitles.php @@ -48,6 +48,10 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $params = $this->extractRequestParams(); diff --git a/includes/api/ApiQueryQueryPage.php b/includes/api/ApiQueryQueryPage.php index d64fb72d50..b09ffa24e1 100644 --- a/includes/api/ApiQueryQueryPage.php +++ b/includes/api/ApiQueryQueryPage.php @@ -60,6 +60,10 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ public function run( $resultPageSet = null ) { global $wgUser; $params = $this->extractRequestParams(); diff --git a/includes/api/ApiQueryRandom.php b/includes/api/ApiQueryRandom.php index 716269b361..9c1f9ede1c 100644 --- a/includes/api/ApiQueryRandom.php +++ b/includes/api/ApiQueryRandom.php @@ -36,7 +36,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { * @ingroup API */ - class ApiQueryRandom extends ApiQueryGeneratorBase { +class ApiQueryRandom extends ApiQueryGeneratorBase { public function __construct( $query, $moduleName ) { parent::__construct( $query, $moduleName, 'rn' ); @@ -50,6 +50,14 @@ if ( !defined( 'MEDIAWIKI' ) ) { $this->run( $resultPageSet ); } + /** + * @param $randstr + * @param $limit + * @param $namespace + * @param $resultPageSet ApiPageSet + * @param $redirect + * @return void + */ protected function prepareQuery( $randstr, $limit, $namespace, &$resultPageSet, $redirect ) { $this->resetQueryParams(); $this->addTables( 'page' ); diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index c062908251..8dc6fe3875 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -71,6 +71,13 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { return $this->tokenFunctions; } + /** + * @static + * @param $pageid + * @param $title + * @param $rc RecentChange + * @return bool|String + */ public static function getPatrolToken( $pageid, $title, $rc ) { global $wgUser; if ( !$wgUser->useRCPatrol() && ( !$wgUser->useNPPatrol() || @@ -118,6 +125,8 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { /** * Generates and outputs the result of this query based upon the provided parameters. + * + * @param $resultPageSet ApiPageSet */ public function run( $resultPageSet = null ) { global $wgUser; diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index c6a7574dc5..64db5bef70 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -73,6 +73,13 @@ class ApiQueryRevisions extends ApiQueryBase { return $this->tokenFunctions; } + /** + * @static + * @param $pageid + * @param $title Title + * @param $rev Revision + * @return bool|String + */ public static function getRollbackToken( $pageid, $title, $rev ) { global $wgUser; if ( !$wgUser->isAllowed( 'rollback' ) ) { diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 2939b98772..59d7e9f1b7 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -48,6 +48,10 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { global $wgContLang; $params = $this->extractRequestParams(); diff --git a/includes/api/ApiQueryTags.php b/includes/api/ApiQueryTags.php index 1276cfffea..bf012dca4d 100644 --- a/includes/api/ApiQueryTags.php +++ b/includes/api/ApiQueryTags.php @@ -36,7 +36,12 @@ if ( !defined( 'MEDIAWIKI' ) ) { */ class ApiQueryTags extends ApiQueryBase { - private $limit, $result; + /** + * @var ApiResult + */ + private $result; + + private $limit; private $fld_displayname = false, $fld_description = false, $fld_hitcount = false; diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 4dc4d4127a..e29394b5ba 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -66,6 +66,11 @@ if ( !defined( 'MEDIAWIKI' ) ) { return $this->tokenFunctions; } + /** + * @static + * @param $user User + * @return String + */ public static function getUserrightsToken( $user ) { global $wgUser; // Since the permissions check for userrights is non-trivial, diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 971563269a..5367e6a1c1 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -53,6 +53,10 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $fld_timestamp = false, $fld_user = false, $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false, $fld_notificationtimestamp = false, $fld_userid = false; + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' ); diff --git a/includes/api/ApiQueryWatchlistRaw.php b/includes/api/ApiQueryWatchlistRaw.php index 082a50ebd5..fa76956a38 100644 --- a/includes/api/ApiQueryWatchlistRaw.php +++ b/includes/api/ApiQueryWatchlistRaw.php @@ -49,6 +49,10 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' ); diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 77a291fdc7..658fa117f7 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -33,7 +33,12 @@ if ( !defined( 'MEDIAWIKI' ) ) { * @ingroup API */ class ApiUpload extends ApiBase { + + /** + * @var UploadBase + */ protected $mUpload = null; + protected $mParams; public function __construct( $main, $action ) { @@ -138,7 +143,6 @@ class ApiUpload extends ApiBase { return $sessionKey; } - /** * Select an upload module and set it to mUpload. Dies on failure. If the * request was a status request and not a true upload, returns false; @@ -376,7 +380,6 @@ class ApiUpload extends ApiBase { $result['result'] = 'Success'; $result['filename'] = $file->getName(); - return $result; } diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index a517b5a721..9549504db8 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -504,7 +504,7 @@ abstract class UploadBase { * Really perform the upload. Stores the file in the local repo, watches * if necessary and runs the UploadComplete hook. * - * @return mixed Status indicating the whether the upload succeeded. + * @return Status indicating the whether the upload succeeded. */ public function performUpload( $comment, $pageText, $watch, $user ) { $status = $this->getLocalFile()->upload( @@ -657,7 +657,7 @@ abstract class UploadBase { * API request to find this stashed file again. * * @param $key String: (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated. - * @return File: stashed file + * @return File stashed file */ public function stashSessionFile( $key = null ) { $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();