Fixed some @params documentation (includes/api)

Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I758fa4ad80ac95e2ddd3770bcb9b7d2e57ec34ea
This commit is contained in:
umherirrender 2014-04-15 20:12:09 +02:00 committed by Umherirrender
parent f8568f7bd9
commit e63299d208
53 changed files with 299 additions and 290 deletions

View file

@ -93,7 +93,7 @@ abstract class ApiBase extends ContextSource {
/**
* Constructor
* @param $mainModule ApiMain object
* @param ApiMain $mainModule
* @param string $moduleName Name of this module
* @param string $modulePrefix Prefix to use for parameter names
*/
@ -170,7 +170,7 @@ abstract class ApiBase extends ContextSource {
/**
* Get the name of the module as shown in the profiler log
*
* @param $db DatabaseBase|bool
* @param DatabaseBase|bool $db
*
* @return string
*/
@ -184,7 +184,7 @@ abstract class ApiBase extends ContextSource {
/**
* Get the main module
* @return ApiMain object
* @return ApiMain
*/
public function getMain() {
return $this->mMainModule;
@ -274,7 +274,7 @@ abstract class ApiBase extends ContextSource {
* If the module may only be used with a certain format module,
* it should override this method to return an instance of that formatter.
* A value of null means the default format will be used.
* @return mixed instance of a derived class of ApiFormatBase, or null
* @return mixed Instance of a derived class of ApiFormatBase, or null
*/
public function getCustomPrinter() {
return null;
@ -282,7 +282,7 @@ abstract class ApiBase extends ContextSource {
/**
* Generates help message for this module, or false if there is no description
* @return mixed string or false
* @return string|bool
*/
public function makeHelpMsg() {
static $lnPrfx = "\n ";
@ -349,7 +349,7 @@ abstract class ApiBase extends ContextSource {
}
/**
* @param $item string
* @param string $item
* @return string
*/
private function indentExampleText( $item ) {
@ -359,7 +359,7 @@ abstract class ApiBase extends ContextSource {
/**
* @param string $prefix Text to split output items
* @param string $title What is being output
* @param $input string|array
* @param string|array $input
* @return string
*/
protected function makeHelpArrayToString( $prefix, $title, $input ) {
@ -387,7 +387,7 @@ abstract class ApiBase extends ContextSource {
/**
* Generates the parameter descriptions for this module, to be displayed in the
* module's help.
* @return string or false
* @return string|bool
*/
public function makeHelpMsgParameters() {
$params = $this->getFinalParams( ApiBase::GET_VALUES_FOR_HELP );
@ -537,7 +537,7 @@ abstract class ApiBase extends ContextSource {
/**
* Returns the description string for this module
* @return mixed string or array of strings
* @return string|array
*/
protected function getDescription() {
return false;
@ -584,7 +584,7 @@ abstract class ApiBase extends ContextSource {
* tweak it as needed.
*
* @param int $flags Zero or more flags like GET_VALUES_FOR_HELP
* @return array|Bool False on no parameters
* @return array|bool False on no parameters
* @since 1.21 $flags param added
*/
public function getFinalParams( $flags = 0 ) {
@ -643,6 +643,8 @@ abstract class ApiBase extends ContextSource {
/**
* Add token properties to the array used by getResultProperties,
* based on a token functions mapping.
* @param array $props
* @param array $tokenFunctions
*/
protected static function addTokenProperties( &$props, $tokenFunctions ) {
foreach ( array_keys( $tokenFunctions ) as $token ) {
@ -682,7 +684,7 @@ abstract class ApiBase extends ContextSource {
* value - validated value from user or default. limits will not be
* parsed if $parseLimit is set to false; use this when the max
* limit is not definitive yet, e.g. when getting revisions.
* @param $parseLimit Boolean: true by default
* @param bool $parseLimit True by default
* @return array
*/
public function extractRequestParams( $parseLimit = true ) {
@ -706,7 +708,7 @@ abstract class ApiBase extends ContextSource {
/**
* Get a value for the given parameter
* @param string $paramName Parameter name
* @param bool $parseLimit see extractRequestParams()
* @param bool $parseLimit See extractRequestParams()
* @return mixed Parameter value
*/
protected function getParameter( $paramName, $parseLimit = true ) {
@ -718,7 +720,7 @@ abstract class ApiBase extends ContextSource {
/**
* Die if none or more than one of a certain set of parameters is set and not false.
* @param array $params of parameter names
* @param array $params Array of parameter names
*/
public function requireOnlyOneParameter( $params ) {
$required = func_get_args();
@ -743,7 +745,7 @@ abstract class ApiBase extends ContextSource {
/**
* Generates the possible errors requireOnlyOneParameter() can die with
*
* @param $params array
* @param array $params
* @return array
*/
public function getRequireOnlyOneParameterErrorMessages( $params ) {
@ -765,7 +767,7 @@ abstract class ApiBase extends ContextSource {
/**
* Die if more than one of a certain set of parameters is set and not false.
*
* @param $params array
* @param array $params
*/
public function requireMaxOneParameter( $params ) {
$required = func_get_args();
@ -786,7 +788,7 @@ abstract class ApiBase extends ContextSource {
/**
* Generates the possible error requireMaxOneParameter() can die with
*
* @param $params array
* @param array $params
* @return array
*/
public function getRequireMaxOneParameterErrorMessages( $params ) {
@ -828,7 +830,7 @@ abstract class ApiBase extends ContextSource {
* Generates the possible errors requireAtLeastOneParameter() can die with
*
* @since 1.23
* @param $params array Array of parameter key names
* @param array $params Array of parameter key names
* @return array
*/
public function getRequireAtLeastOneParameterErrorMessages( $params ) {
@ -844,7 +846,7 @@ abstract class ApiBase extends ContextSource {
}
/**
* @param $params array
* @param array $params
* @param bool|string $load Whether load the object's state from the database:
* - false: don't load (if the pageid is given, it will still be loaded)
* - 'fromdb': load from a slave database
@ -896,7 +898,7 @@ abstract class ApiBase extends ContextSource {
/**
* Callback function used in requireOnlyOneParameter to check whether required parameters are set
*
* @param $x object Parameter to check is not null/false
* @param object $x Parameter to check is not null/false
* @return bool
*/
private function parameterNotEmpty( $x ) {
@ -906,7 +908,7 @@ abstract class ApiBase extends ContextSource {
/**
* Return true if we're to watch the page, false if not, null if no change.
* @param string $watchlist Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
* @param $titleObj Title the page under consideration
* @param Title $titleObj The page under consideration
* @param string $userOption The user option to consider when $watchlist=preferences.
* If not set will use watchdefault always and watchcreations if $titleObj doesn't exist.
* @return bool
@ -947,7 +949,7 @@ abstract class ApiBase extends ContextSource {
/**
* Set a watch (or unwatch) based the based on a watchlist parameter.
* @param string $watch Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
* @param $titleObj Title the article's title to change
* @param Title $titleObj The article's title to change
* @param string $userOption The user option to consider when $watch=preferences
*/
protected function setWatch( $watch, $titleObj, $userOption = null ) {
@ -962,10 +964,10 @@ abstract class ApiBase extends ContextSource {
/**
* Using the settings determine the value for the given parameter
*
* @param string $paramName parameter name
* @param array|mixed $paramSettings default value or an array of settings
* @param string $paramName Parameter name
* @param array|mixed $paramSettings Default value or an array of settings
* using PARAM_* constants.
* @param $parseLimit Boolean: parse limit?
* @param bool $parseLimit Parse limit?
* @return mixed Parameter value
*/
protected function getParameterFromSettings( $paramName, $paramSettings, $parseLimit ) {
@ -1180,10 +1182,10 @@ abstract class ApiBase extends ContextSource {
*
* @param string $valueName The name of the parameter (for error
* reporting)
* @param $value mixed The value being parsed
* @param mixed $value The value being parsed
* @param bool $allowMultiple Can $value contain more than one value
* separated by '|'?
* @param $allowedValues mixed An array of values to check against. If
* @param mixed $allowedValues An array of values to check against. If
* null, all values are accepted.
* @return mixed (allowMultiple ? an_array_of_values : a_single_value)
*/
@ -1249,7 +1251,7 @@ abstract class ApiBase extends ContextSource {
* @param int|null $min Minimum value
* @param int|null $max Maximum value for users
* @param int $botMax Maximum value for sysops/bots
* @param $enforceLimits Boolean Whether to enforce (die) if value is outside limits
* @param bool $enforceLimits Whether to enforce (die) if value is outside limits
*/
function validateLimit( $paramName, &$value, $min, $max, $botMax = null, $enforceLimits = false ) {
if ( !is_null( $min ) && $value < $min ) {
@ -1322,8 +1324,8 @@ abstract class ApiBase extends ContextSource {
/**
* Adds a warning to the output, else dies
*
* @param $msg String Message to show as a warning, or error message if dying
* @param $enforceLimits Boolean Whether this is an enforce (die)
* @param string $msg Message to show as a warning, or error message if dying
* @param bool $enforceLimits Whether this is an enforce (die)
*/
private function warnOrDie( $msg, $enforceLimits = false ) {
if ( $enforceLimits ) {
@ -1375,8 +1377,8 @@ abstract class ApiBase extends ContextSource {
* Get error (as code, string) from a Status object.
*
* @since 1.23
* @param Status $status Status object
* @return array of code and error string
* @param Status $status
* @return array Array of code and error string
*/
public function getErrorFromStatus( $status ) {
if ( $status->isGood() ) {
@ -1414,7 +1416,7 @@ abstract class ApiBase extends ContextSource {
* Throw a UsageException based on the errors in the Status object.
*
* @since 1.22
* @param Status $status Status object
* @param Status $status
* @throws MWException
*/
public function dieStatus( $status ) {
@ -1925,7 +1927,7 @@ abstract class ApiBase extends ContextSource {
/**
* Output the error message related to a certain array
* @param $error (array|string) Element of a getUserPermissionsErrors()-style array
* @param array|string $error Element of a getUserPermissionsErrors()-style array
*/
public function dieUsageMsg( $error ) {
# most of the time we send a 1 element, so we might as well send it as
@ -1940,7 +1942,7 @@ abstract class ApiBase extends ContextSource {
/**
* Will only set a warning instead of failing if the global $wgDebugAPI
* is set to true. Otherwise behaves exactly as dieUsageMsg().
* @param $error (array|string) Element of a getUserPermissionsErrors()-style array
* @param array|string $error Element of a getUserPermissionsErrors()-style array
* @since 1.21
*/
public function dieUsageMsgOrDebug( $error ) {
@ -1960,7 +1962,7 @@ abstract class ApiBase extends ContextSource {
/**
* Die with the $prefix.'badcontinue' error. This call is common enough to
* make it into the base method.
* @param $condition boolean will only die if this value is true
* @param bool $condition Will only die if this value is true
* @since 1.21
*/
protected function dieContinueUsageIf( $condition ) {
@ -2065,7 +2067,7 @@ abstract class ApiBase extends ContextSource {
/**
* Gets the user for whom to get the watchlist
*
* @param $params array
* @param array $params
* @return User
*/
public function getWatchlistUser( $params ) {
@ -2108,7 +2110,7 @@ abstract class ApiBase extends ContextSource {
* Don't call this function directly: use getFinalPossibleErrors() to allow
* hooks to modify parameters as needed.
*
* @return array in the format of array( key, param1, param2, ... )
* @return array Array in the format of array( key, param1, param2, ... )
* or array( 'code' => ..., 'info' => ... )
*/
public function getPossibleErrors() {
@ -2322,7 +2324,7 @@ abstract class ApiBase extends ContextSource {
/**
* Debugging function that prints a value and an optional backtrace
* @param $value mixed Value to print
* @param mixed $value Value to print
* @param string $name Description of the printed value
* @param bool $backtrace If true, print a backtrace
*/

View file

@ -78,9 +78,9 @@ class ApiComparePages extends ApiBase {
}
/**
* @param $revision int
* @param $titleText string
* @param $titleId int
* @param int $revision
* @param string $titleText
* @param int $titleId
* @return int
*/
private function revisionOrTitleOrId( $revision, $titleText, $titleId ) {

View file

@ -89,9 +89,9 @@ class ApiDelete extends ApiBase {
}
/**
* @param $title Title
* @param $user User doing the action
* @param $token String
* @param Title $title
* @param User $user User doing the action
* @param string $token
* @return array
*/
private static function getPermissionsError( $title, $user, $token ) {
@ -102,8 +102,8 @@ class ApiDelete extends ApiBase {
/**
* We have our own delete() function, since Article.php's implementation is split in two phases
*
* @param $page Page|WikiPage object to work on
* @param $user User doing the action
* @param Page|WikiPage $page Page or WikiPage object to work on
* @param User $user User doing the action
* @param string $token delete token (same as edit token)
* @param string|null $reason reason for the deletion. Autogenerated if NULL
* @return Status|array

View file

@ -123,7 +123,7 @@ class ApiFeedContributions extends ApiBase {
}
/**
* @param $revision Revision
* @param Revision $revision
* @return string
*/
protected function feedItemAuthor( $revision ) {
@ -131,7 +131,7 @@ class ApiFeedContributions extends ApiBase {
}
/**
* @param $revision Revision
* @param Revision $revision
* @return string
*/
protected function feedItemDesc( $revision ) {

View file

@ -167,7 +167,7 @@ class ApiFeedWatchlist extends ApiBase {
}
/**
* @param $info array
* @param array $info
* @return FeedItem
*/
private function createFeedItem( $info ) {

View file

@ -71,7 +71,7 @@ class ApiFileRevert extends ApiBase {
/**
* Checks that the user has permissions to perform this revert.
* Dies with usage message on inadequate permissions.
* @param $user User The user to check.
* @param User $user The user to check.
*/
protected function checkPermissions( $user ) {
$title = $this->file->getTitle();

View file

@ -36,7 +36,7 @@ abstract class ApiFormatBase extends ApiBase {
/**
* Constructor
* If $format ends with 'fm', pretty-print the output in HTML.
* @param $main ApiMain
* @param ApiMain $main
* @param string $format Format name
*/
public function __construct( $main, $format ) {
@ -224,7 +224,7 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
* The main format printing function. Call it to output the result
* string to the user. This function will automatically output HTML
* when format name ends in 'fm'.
* @param $text string
* @param string $text
*/
public function printText( $text ) {
if ( $this->mDisabled ) {
@ -255,7 +255,7 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
/**
* Set the flag to buffer the result instead of printing it.
* @param $value bool
* @param bool $value
*/
public function setBufferResult( $value ) {
$this->mBufferResult = $value;
@ -263,7 +263,7 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
/**
* Sets whether the pretty-printer should format *bold*
* @param $help bool
* @param bool $help
*/
public function setHelp( $help = true ) {
$this->mHelp = $help;
@ -272,7 +272,7 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
/**
* Pretty-print various elements in HTML format, such as xml tags and
* URLs. This method also escapes characters like <
* @param $text string
* @param string $text
* @return string
*/
protected function formatHTML( $text ) {
@ -353,8 +353,8 @@ class ApiFormatFeedWrapper extends ApiFormatBase {
/**
* Call this method to initialize output data. See execute()
* @param $result ApiResult
* @param $feed object an instance of one of the $wgFeedClasses classes
* @param ApiResult $result
* @param object $feed An instance of one of the $wgFeedClasses classes
* @param array $feedItems of FeedItem objects
*/
public static function setResult( $result, $feed, $feedItems ) {

View file

@ -32,8 +32,8 @@ class ApiFormatRaw extends ApiFormatBase {
/**
* Constructor
* @param $main ApiMain object
* @param $errorFallback ApiFormatBase object to fall back on for errors
* @param ApiMain $main
* @param ApiFormatBase $errorFallback ApiFormatBase object to fall back on for errors
*/
public function __construct( $main, $errorFallback ) {
parent::__construct( $main, 'raw' );

View file

@ -62,8 +62,8 @@ class ApiFormatWddx extends ApiFormatBase {
/**
* Recursively go through the object and output its data in WDDX format.
* @param $elemValue
* @param $indent int
* @param mixed $elemValue
* @param int $indent
*/
function slowWddxPrinter( $elemValue, $indent = 0 ) {
$indstr = ( $this->getIsHtml() ? str_repeat( ' ', $indent ) : '' );

View file

@ -111,9 +111,9 @@ class ApiFormatXml extends ApiFormatBase {
* @note The method is recursive, so the same rules apply to any
* sub-arrays.
*
* @param $elemName
* @param $elemValue
* @param $indent
* @param string $elemName
* @param mixed $elemValue
* @param int $indent
*
* @return string
*/

View file

@ -107,8 +107,8 @@ class ApiHelp extends ApiBase {
}
/**
* @param $module ApiBase
* @param $type String What type of request is this? e.g. action, query, list, prop, meta, format
* @param ApiBase $module
* @param string $type What type of request is this? e.g. action, query, list, prop, meta, format
* @return string
*/
private function buildModuleHelp( $module, $type ) {

View file

@ -196,11 +196,11 @@ class ApiImportReporter extends ImportReporter {
private $mResultArr = array();
/**
* @param $title Title
* @param $origTitle Title
* @param $revisionCount int
* @param $successCount int
* @param $pageInfo
* @param Title $title
* @param Title $origTitle
* @param int $revisionCount
* @param int $successCount
* @param array $pageInfo
* @return void
*/
function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {

View file

@ -147,9 +147,9 @@ class ApiMain extends ApiBase {
/**
* Constructs an instance of ApiMain that utilizes the module and format specified by $request.
*
* @param $context IContextSource|WebRequest - if this is an instance of
* @param IContextSource|WebRequest $context If this is an instance of
* FauxRequest, errors are thrown and no printing occurs
* @param bool $enableWrite should be set to true if the api may modify data
* @param bool $enableWrite Should be set to true if the api may modify data
*/
public function __construct( $context = null, $enableWrite = false ) {
if ( $context === null ) {
@ -238,7 +238,7 @@ class ApiMain extends ApiBase {
/**
* Set how long the response should be cached.
*
* @param $maxage
* @param int $maxage
*/
public function setCacheMaxAge( $maxage ) {
$this->setCacheControl( array(
@ -301,7 +301,7 @@ class ApiMain extends ApiBase {
* Cache control values set here will only be used if the cache mode is not
* private, see setCacheMode().
*
* @param $directives array
* @param array $directives
*/
public function setCacheControl( $directives ) {
$this->mCacheControl = $directives + $this->mCacheControl;
@ -310,7 +310,7 @@ class ApiMain extends ApiBase {
/**
* Create an instance of an output formatter by its name
*
* @param $format string
* @param string $format
*
* @return ApiFormatBase
*/
@ -637,7 +637,7 @@ class ApiMain extends ApiBase {
/**
* Replace the result data with the information about an exception.
* Returns the error code
* @param $e Exception
* @param Exception $e
* @return string
*/
protected function substituteResultWithError( $e ) {
@ -782,9 +782,9 @@ class ApiMain extends ApiBase {
/**
* Check the max lag if necessary
* @param $module ApiBase object: Api module being used
* @param array $params an array containing the request parameters.
* @return boolean True on success, false should exit immediately
* @param ApiBase $module Api module being used
* @param array $params Array an array containing the request parameters.
* @return bool True on success, false should exit immediately
*/
protected function checkMaxLag( $module, $params ) {
if ( $module->shouldCheckMaxlag() && isset( $params['maxlag'] ) ) {
@ -811,7 +811,7 @@ class ApiMain extends ApiBase {
/**
* Check for sufficient permissions to execute
* @param $module ApiBase An Api module
* @param ApiBase $module An Api module
*/
protected function checkExecutePermissions( $module ) {
$user = $this->getUser();
@ -841,7 +841,7 @@ class ApiMain extends ApiBase {
/**
* Check asserts of the user's rights
* @param $params array
* @param array $params
*/
protected function checkAsserts( $params ) {
if ( isset( $params['assert'] ) ) {
@ -863,7 +863,7 @@ class ApiMain extends ApiBase {
/**
* Check POST for external response and setup result printer
* @param $module ApiBase An Api module
* @param ApiBase $module An Api module
* @param array $params an array with the request parameters
*/
protected function setupExternalResponse( $module, $params ) {
@ -953,6 +953,8 @@ class ApiMain extends ApiBase {
/**
* Encode a value in a format suitable for a space-separated log line.
* @param string $s
* return string
*/
protected function encodeRequestLogValue( $s ) {
static $table;
@ -969,6 +971,7 @@ class ApiMain extends ApiBase {
/**
* Get the request parameters used in the course of the preceding execute() request
* @return array
*/
protected function getParamsUsed() {
return array_keys( $this->mParamsUsed );
@ -976,6 +979,9 @@ class ApiMain extends ApiBase {
/**
* Get a request value, and register the fact that it was used, for logging.
* @param string $name
* @param mixed $default
* @return mixed
*/
public function getVal( $name, $default = null ) {
$this->mParamsUsed[$name] = true;
@ -986,6 +992,8 @@ class ApiMain extends ApiBase {
/**
* Get a boolean request value, and register the fact that the parameter
* was used, for logging.
* @param string $name
* @return bool
*/
public function getCheck( $name ) {
$this->mParamsUsed[$name] = true;
@ -1034,7 +1042,7 @@ class ApiMain extends ApiBase {
/**
* Print results using the current printer
*
* @param $isError bool
* @param bool $isError
*/
protected function printResult( $isError ) {
global $wgDebugAPI;
@ -1224,7 +1232,7 @@ class ApiMain extends ApiBase {
/**
* Sets whether the pretty-printer should format *bold* and $italics$
*
* @param $help bool
* @param bool $help
*/
public function setHelp( $help = true ) {
$this->mPrinter->setHelp( $help );
@ -1302,7 +1310,7 @@ class ApiMain extends ApiBase {
}
/**
* @param $module ApiBase
* @param ApiBase $module
* @param string $paramName What type of request is this? e.g. action,
* query, list, prop, meta, format
* @return string
@ -1356,7 +1364,7 @@ class ApiMain extends ApiBase {
*
* @deprecated since 1.21, Use getModuleManager()->addModule() instead.
* @param string $name The identifier for this module.
* @param $class ApiBase The class where this module is implemented.
* @param ApiBase $class The class where this module is implemented.
*/
protected function addModule( $name, $class ) {
$this->getModuleManager()->addModule( $name, 'action', $class );
@ -1368,7 +1376,7 @@ class ApiMain extends ApiBase {
*
* @deprecated since 1.21, Use getModuleManager()->addModule() instead.
* @param string $name The identifier for this format.
* @param $class ApiFormatBase The class implementing this format.
* @param ApiFormatBase $class The class implementing this format.
*/
protected function addFormat( $name, $class ) {
$this->getModuleManager()->addModule( $name, 'format', $class );
@ -1411,10 +1419,10 @@ class UsageException extends MWException {
private $mExtraData;
/**
* @param $message string
* @param $codestr string
* @param $code int
* @param $extradata array|null
* @param string $message
* @param string $codestr
* @param int $code
* @param array|null $extradata
*/
public function __construct( $message, $codestr, $code = 0, $extradata = null ) {
parent::__construct( $message, $code );

View file

@ -73,10 +73,10 @@ class ApiModuleManager extends ContextSource {
/**
* Get module instance by name, or instantiate it if it does not exist
* @param string $moduleName module name
* @param string $group optionally validate that the module is in a specific group
* @param bool $ignoreCache if true, force-creates a new instance and does not cache it
* @return mixed the new module instance, or null if failed
* @param string $moduleName Module name
* @param string $group Optionally validate that the module is in a specific group
* @param bool $ignoreCache If true, force-creates a new instance and does not cache it
* @return mixed The new module instance, or null if failed
*/
public function getModule( $moduleName, $group = null, $ignoreCache = false ) {
if ( !isset( $this->mModules[$moduleName] ) ) {
@ -104,8 +104,8 @@ class ApiModuleManager extends ContextSource {
/**
* Get an array of modules in a specific group or all if no group is set.
* @param string $group optional group filter
* @return array list of module names
* @param string $group Optional group filter
* @return array List of module names
*/
public function getNames( $group = null ) {
if ( $group === null ) {
@ -123,8 +123,8 @@ class ApiModuleManager extends ContextSource {
/**
* Create an array of (moduleName => moduleClass) for a specific group or for all.
* @param string $group name of the group to get or null for all
* @return array name=>class map
* @param string $group Name of the group to get or null for all
* @return array Name=>class map
*/
public function getNamesWithClasses( $group = null ) {
$result = array();
@ -139,9 +139,9 @@ class ApiModuleManager extends ContextSource {
/**
* Returns true if the specific module is defined at all or in a specific group.
* @param string $moduleName module name
* @param string $group group name to check against, or null to check all groups,
* @return boolean true if defined
* @param string $moduleName Module name
* @param string $group Group name to check against, or null to check all groups,
* @return bool True if defined
*/
public function isDefined( $moduleName, $group = null ) {
if ( isset( $this->mModules[$moduleName] ) ) {
@ -154,7 +154,7 @@ class ApiModuleManager extends ContextSource {
/**
* Returns the group name for the given module
* @param string $moduleName
* @return string group name or null if missing
* @return string Group name or null if missing
*/
public function getModuleGroup( $moduleName ) {
if ( isset( $this->mModules[$moduleName] ) ) {

View file

@ -148,8 +148,8 @@ class ApiMove extends ApiBase {
/**
* @param Title $fromTitle
* @param Title $toTitle
* @param $reason
* @param $noredirect
* @param string $reason
* @param bool $noredirect
* @return array
*/
public function moveSubpages( $fromTitle, $toTitle, $reason, $noredirect ) {

View file

@ -75,10 +75,10 @@ class ApiPageSet extends ApiBase {
/**
* Add all items from $values into the result
* @param array $result output
* @param array $values values to add
* @param string $flag the name of the boolean flag to mark this element
* @param string $name if given, name of the value
* @param array $result Output
* @param array $values Values to add
* @param string $flag The name of the boolean flag to mark this element
* @param string $name If given, name of the value
*/
private static function addValues( array &$result, $values, $flag = null, $name = null ) {
foreach ( $values as $val ) {
@ -99,10 +99,10 @@ class ApiPageSet extends ApiBase {
/**
* Constructor
* @param $dbSource ApiBase Module implementing getDB().
* @param ApiBase $dbSource Module implementing getDB().
* Allows PageSet to reuse existing db connection from the shared state like ApiQuery.
* @param int $flags Zero or more flags like DISABLE_GENERATORS
* @param int $defaultNamespace the namespace to use if none is specified by a prefix.
* @param int $defaultNamespace The namespace to use if none is specified by a prefix.
* @since 1.21 accepts $flags instead of two boolean values
*/
public function __construct( ApiBase $dbSource, $flags = 0, $defaultNamespace = NS_MAIN ) {
@ -296,7 +296,7 @@ class ApiPageSet extends ApiBase {
* Get the fields that have to be queried from the page table:
* the ones requested through requestField() and a few basic ones
* we always need
* @return array of field names
* @return array Array of field names
*/
public function getPageTableFields() {
// Ensure we get minimum required fields
@ -381,7 +381,7 @@ class ApiPageSet extends ApiBase {
/**
* Page IDs that were not found in the database
* @return array of page IDs
* @return array Array of page IDs
*/
public function getMissingPageIDs() {
return $this->mMissingPageIDs;
@ -399,8 +399,8 @@ class ApiPageSet extends ApiBase {
/**
* Get a list of redirect resolutions - maps a title to its redirect
* target.
* @param $result ApiResult
* @return array of prefixed_title (string) => Title object
* @param ApiResult $result
* @return array Array of prefixed_title (string) => Title object
* @since 1.21
*/
public function getRedirectTitlesAsResult( $result = null ) {
@ -425,7 +425,7 @@ class ApiPageSet extends ApiBase {
/**
* Get a list of title normalizations - maps a title to its normalized
* version.
* @return array raw_prefixed_title (string) => prefixed_title (string)
* @return array Array of raw_prefixed_title (string) => prefixed_title (string)
*/
public function getNormalizedTitles() {
return $this->mNormalizedTitles;
@ -434,8 +434,8 @@ class ApiPageSet extends ApiBase {
/**
* Get a list of title normalizations - maps a title to its normalized
* version in the form of result array.
* @param $result ApiResult
* @return array of raw_prefixed_title (string) => prefixed_title (string)
* @param ApiResult $result
* @return array Array of raw_prefixed_title (string) => prefixed_title (string)
* @since 1.21
*/
public function getNormalizedTitlesAsResult( $result = null ) {
@ -456,7 +456,7 @@ class ApiPageSet extends ApiBase {
/**
* Get a list of title conversions - maps a title to its converted
* version.
* @return array raw_prefixed_title (string) => prefixed_title (string)
* @return array Array of raw_prefixed_title (string) => prefixed_title (string)
*/
public function getConvertedTitles() {
return $this->mConvertedTitles;
@ -465,8 +465,8 @@ class ApiPageSet extends ApiBase {
/**
* Get a list of title conversions - maps a title to its converted
* version as a result array.
* @param $result ApiResult
* @return array of (from, to) strings
* @param ApiResult $result
* @return array Array of (from, to) strings
* @since 1.21
*/
public function getConvertedTitlesAsResult( $result = null ) {
@ -487,7 +487,7 @@ class ApiPageSet extends ApiBase {
/**
* Get a list of interwiki titles - maps a title to its interwiki
* prefix.
* @return array raw_prefixed_title (string) => interwiki_prefix (string)
* @return array Array of raw_prefixed_title (string) => interwiki_prefix (string)
*/
public function getInterwikiTitles() {
return $this->mInterwikiTitles;
@ -496,9 +496,9 @@ class ApiPageSet extends ApiBase {
/**
* Get a list of interwiki titles - maps a title to its interwiki
* prefix as result.
* @param $result ApiResult
* @param $iwUrl boolean
* @return array raw_prefixed_title (string) => interwiki_prefix (string)
* @param ApiResult $result
* @param bool $iwUrl
* @return array Array of raw_prefixed_title (string) => interwiki_prefix (string)
* @since 1.21
*/
public function getInterwikiTitlesAsResult( $result = null, $iwUrl = false ) {
@ -524,7 +524,7 @@ class ApiPageSet extends ApiBase {
/**
* Get an array of invalid/special/missing titles.
*
* @param $invalidChecks List of types of invalid titles to include.
* @param array $invalidChecks List of types of invalid titles to include.
* Recognized values are:
* - invalidTitles: Titles from $this->getInvalidTitles()
* - special: Titles from $this->getSpecialTitles()
@ -563,7 +563,7 @@ class ApiPageSet extends ApiBase {
/**
* Get the list of revision IDs (requested with the revids= parameter)
* @return array revID (int) => pageID (int)
* @return array Array of revID (int) => pageID (int)
*/
public function getRevisionIDs() {
return $this->mGoodRevIDs;
@ -571,7 +571,7 @@ class ApiPageSet extends ApiBase {
/**
* Revision IDs that were not found in the database
* @return array of revision IDs
* @return array Array of revision IDs
*/
public function getMissingRevisionIDs() {
return $this->mMissingRevIDs;
@ -579,8 +579,8 @@ class ApiPageSet extends ApiBase {
/**
* Revision IDs that were not found in the database as result array.
* @param $result ApiResult
* @return array of revision IDs
* @param ApiResult $result
* @return array Array of revision IDs
* @since 1.21
*/
public function getMissingRevisionIDsAsResult( $result = null ) {
@ -615,7 +615,7 @@ class ApiPageSet extends ApiBase {
/**
* Populate this PageSet from a list of Titles
* @param array $titles of Title objects
* @param array $titles Array of Title objects
*/
public function populateFromTitles( $titles ) {
$this->profileIn();
@ -625,7 +625,7 @@ class ApiPageSet extends ApiBase {
/**
* Populate this PageSet from a list of page IDs
* @param array $pageIDs of page IDs
* @param array $pageIDs Array of page IDs
*/
public function populateFromPageIDs( $pageIDs ) {
$this->profileIn();
@ -635,8 +635,8 @@ class ApiPageSet extends ApiBase {
/**
* Populate this PageSet from a rowset returned from the database
* @param $db DatabaseBase object
* @param $queryResult ResultWrapper Query result object
* @param DatabaseBase $db
* @param ResultWrapper $queryResult Query result object
*/
public function populateFromQueryResult( $db, $queryResult ) {
$this->profileIn();
@ -646,7 +646,7 @@ class ApiPageSet extends ApiBase {
/**
* Populate this PageSet from a list of revision IDs
* @param array $revIDs of revision IDs
* @param array $revIDs Array of revision IDs
*/
public function populateFromRevisionIDs( $revIDs ) {
$this->profileIn();
@ -699,7 +699,7 @@ class ApiPageSet extends ApiBase {
* #5 Substitute the original LinkBatch object with the new list
* #6 Repeat from step #1
*
* @param array $titles of Title objects or strings
* @param array $titles Array of Title objects or strings
*/
private function initFromTitles( $titles ) {
// Get validated and normalized title objects
@ -726,7 +726,7 @@ class ApiPageSet extends ApiBase {
/**
* Does the same as initFromTitles(), but is based on page IDs instead
* @param array $pageids of page IDs
* @param array $pageids Array of page IDs
*/
private function initFromPageIds( $pageids ) {
if ( !$pageids ) {
@ -761,8 +761,8 @@ class ApiPageSet extends ApiBase {
/**
* Iterate through the result of the query on 'page' table,
* and for each row create and store title object and save any extra fields requested.
* @param $res ResultWrapper DB Query result
* @param array $remaining of either pageID or ns/title elements (optional).
* @param ResultWrapper $res DB Query result
* @param array $remaining Array of either pageID or ns/title elements (optional).
* If given, any missing items will go to $mMissingPageIDs and $mMissingTitles
* @param bool $processTitles Must be provided together with $remaining.
* If true, treat $remaining as an array of [ns][title]
@ -833,7 +833,7 @@ class ApiPageSet extends ApiBase {
/**
* Does the same as initFromTitles(), but is based on revision IDs
* instead
* @param array $revids of revision IDs
* @param array $revids Array of revision IDs
*/
private function initFromRevIDs( $revids ) {
if ( !$revids ) {
@ -976,7 +976,7 @@ class ApiPageSet extends ApiBase {
* Public caching will only be allowed if *all* the modules that supply
* data for a given request return a cache mode of public.
*
* @param $params
* @param array|null $params
* @return string
* @since 1.21
*/
@ -990,7 +990,7 @@ class ApiPageSet extends ApiBase {
* This method validates access rights for the title,
* and appends normalization values to the output.
*
* @param array $titles of Title objects or strings
* @param array $titles Array of Title objects or strings
* @return LinkBatch
*/
private function processTitlesArray( $titles ) {
@ -1078,7 +1078,7 @@ class ApiPageSet extends ApiBase {
/**
* Returns the input array of integers with all values < 0 removed
*
* @param $array array
* @param array $array
* @return array
*/
private static function getPositiveIntegers( $array ) {

View file

@ -66,10 +66,10 @@ class ApiParamInfo extends ApiBase {
/**
* If the type is requested in parameters, adds a section to res with module info.
* @param array $params user parameters array
* @param string $type parameter name
* @param array $res store results in this array
* @param ApiResult $resultObj results object to set indexed tag.
* @param array $params User parameters array
* @param string $type Parameter name
* @param array $res Store results in this array
* @param ApiResult $resultObj Results object to set indexed tag.
*/
private function addModulesInfo( $params, $type, &$res, $resultObj ) {
if ( !is_array( $params[$type] ) ) {
@ -99,7 +99,7 @@ class ApiParamInfo extends ApiBase {
}
/**
* @param $obj ApiBase
* @param ApiBase $obj
* @return ApiResult
*/
private function getClassInfo( $obj ) {

View file

@ -27,7 +27,7 @@
*/
class ApiParse extends ApiBase {
/** @var String $section */
/** @var string $section */
private $section = null;
/** @var Content $content */
@ -431,10 +431,10 @@ class ApiParse extends ApiBase {
}
/**
* @param $page WikiPage
* @param $popts ParserOptions
* @param $pageId Int
* @param $getWikitext Bool
* @param WikiPage $page
* @param ParserOptions $popts
* @param int $pageId
* @param bool $getWikitext
* @return ParserOutput
*/
private function getParsedContent( WikiPage $page, $popts, $pageId = null, $getWikitext = false ) {
@ -549,7 +549,7 @@ class ApiParse extends ApiBase {
/**
* @deprecated since 1.18 No modern skin generates language links this way,
* please use language links data to generate your own HTML.
* @param $languages array
* @param array $languages
* @return string
*/
private function languagesHtml( $languages ) {

View file

@ -122,8 +122,8 @@ class ApiQuery extends ApiBase {
private $mUseLegacyContinue;
/**
* @param $main ApiMain
* @param $action string
* @param ApiMain $main
* @param string $action
*/
public function __construct( $main, $action ) {
parent::__construct( $main, $action );
@ -211,7 +211,7 @@ class ApiQuery extends ApiBase {
* Get whether the specified module is a prop, list or a meta query module
* @deprecated since 1.21, use getModuleManager()->getModuleGroup()
* @param string $moduleName Name of the module to find type for
* @return mixed string or null
* @return string|null
*/
function getModuleType( $moduleName ) {
return $this->getModuleManager()->getModuleGroup( $moduleName );
@ -348,8 +348,8 @@ class ApiQuery extends ApiBase {
/**
* Parse 'continue' parameter into the list of complete modules and a list of generator parameters
* @param array|null $pagesetParams returns list of generator params or null if pageset is done
* @param array|null $completeModules returns list of finished modules (as keys), or null if legacy
* @param array|null $pagesetParams Returns list of generator params or null if pageset is done
* @param array|null $completeModules Returns list of finished modules (as keys), or null if legacy
*/
private function initContinue( &$pagesetParams, &$completeModules ) {
$pagesetParams = array();
@ -383,9 +383,9 @@ class ApiQuery extends ApiBase {
/**
* Validate sub-modules, filter out completed ones, and do requestExtraData()
* @param array $allModules An dict of name=>instance of all modules requested by the client
* @param array|null $completeModules list of finished modules, or null if legacy continue
* @param array|null $completeModules List of finished modules, or null if legacy continue
* @param bool $usePageset True if pageset will be executed
* @return array of modules to be processed during this execution
* @return array Array of modules to be processed during this execution
*/
private function initModules( $allModules, $completeModules, $usePageset ) {
$modules = $allModules;
@ -423,8 +423,8 @@ class ApiQuery extends ApiBase {
* The cache mode may increase in the level of privacy, but public modules
* added to private data do not decrease the level of privacy.
*
* @param $cacheMode string
* @param $modCacheMode string
* @param string $cacheMode
* @param string $modCacheMode
* @return string
*/
protected function mergeCacheMode( $cacheMode, $modCacheMode ) {
@ -443,7 +443,7 @@ class ApiQuery extends ApiBase {
/**
* Create instances of all modules requested by the client
* @param array $modules to append instantiated modules to
* @param array $modules To append instantiated modules to
* @param string $param Parameter name to read modules from
*/
private function instantiateModules( &$modules, $param ) {
@ -563,10 +563,10 @@ class ApiQuery extends ApiBase {
* This method is called by the generator base when generator in the smart-continue
* mode tries to set 'query-continue' value. ApiQuery stores those values separately
* until the post-processing when it is known if the generation should continue or repeat.
* @param ApiQueryGeneratorBase $module generator module
* @param ApiQueryGeneratorBase $module Generator module
* @param string $paramName
* @param mixed $paramValue
* @return bool true if processed, false if this is a legacy continue
* @return bool True if processed, false if this is a legacy continue
*/
public function setGeneratorContinue( $module, $paramName, $paramValue ) {
if ( $this->mUseLegacyContinue ) {
@ -582,8 +582,8 @@ class ApiQuery extends ApiBase {
}
/**
* @param $pageSet ApiPageSet Pages to be exported
* @param $result ApiResult Result to output to
* @param ApiPageSet $pageSet Pages to be exported
* @param ApiResult $result Result to output to
*/
private function doExport( $pageSet, $result ) {
$exportTitles = array();

View file

@ -49,7 +49,7 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
*/
private function run( $resultPageSet = null ) {
$db = $this->getDB();

View file

@ -59,7 +59,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
public function executeGenerator( $resultPageSet ) {
@ -75,7 +75,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -116,7 +116,7 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -44,7 +44,7 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
public function executeGenerator( $resultPageSet ) {
@ -60,7 +60,7 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -38,7 +38,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
* This function converts the user name to a canonical form
* which is stored in the database.
* @param string $name
* @return String
* @return string
*/
private function getCanonicalUserName( $name ) {
return str_replace( '_', ' ', $name );

View file

@ -116,7 +116,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function prepareFirstQuery( $resultPageSet = null ) {
@ -161,7 +161,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function prepareSecondQuery( $resultPageSet = null ) {
@ -242,7 +242,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -36,9 +36,9 @@ abstract class ApiQueryBase extends ApiBase {
private $mQueryModule, $mDb, $tables, $where, $fields, $options, $join_conds;
/**
* @param $query ApiBase
* @param $moduleName string
* @param $paramPrefix string
* @param ApiBase $query
* @param string $moduleName
* @param string $paramPrefix
*/
public function __construct( ApiBase $query, $moduleName, $paramPrefix = '' ) {
parent::__construct( $query->getMain(), $moduleName, $paramPrefix );
@ -55,7 +55,7 @@ abstract class ApiQueryBase extends ApiBase {
* Public caching will only be allowed if *all* the modules that supply
* data for a given request return a cache mode of public.
*
* @param $params
* @param array $params
* @return string
*/
public function getCacheMode( $params ) {
@ -75,8 +75,8 @@ abstract class ApiQueryBase extends ApiBase {
/**
* Add a set of tables to the internal array
* @param $tables mixed Table name or array of table names
* @param $alias mixed Table alias, or null for no alias. Cannot be
* @param mixed $tables Table name or array of table names
* @param mixed $alias Table alias, or null for no alias. Cannot be
* used with multiple tables
*/
protected function addTables( $tables, $alias = null ) {
@ -101,7 +101,7 @@ abstract class ApiQueryBase extends ApiBase {
* conditions) e.g. array('page' => array('LEFT JOIN',
* 'page_id=rev_page')) . conditions may be a string or an
* addWhere()-style array
* @param $join_conds array JOIN conditions
* @param array $join_conds JOIN conditions
*/
protected function addJoinConds( $join_conds ) {
if ( !is_array( $join_conds ) ) {
@ -147,7 +147,7 @@ abstract class ApiQueryBase extends ApiBase {
*
* For example, array('foo=bar', 'baz' => 3, 'bla' => 'foo') translates
* to "foo=bar AND baz='3' AND bla='foo'"
* @param $value mixed String or array
* @param string|array $value
*/
protected function addWhere( $value ) {
if ( is_array( $value ) ) {
@ -163,7 +163,7 @@ abstract class ApiQueryBase extends ApiBase {
/**
* Same as addWhere(), but add the WHERE clauses only if a condition is met
* @param $value mixed See addWhere()
* @param string|array $value
* @param bool $condition If false, do nothing
* @return bool $condition
*/
@ -231,11 +231,11 @@ abstract class ApiQueryBase extends ApiBase {
* Add a WHERE clause corresponding to a range, similar to addWhereRange,
* but converts $start and $end to database timestamps.
* @see addWhereRange
* @param $field
* @param $dir
* @param $start
* @param $end
* @param $sort bool
* @param string $field
* @param string $dir
* @param string $start
* @param string $end
* @param bool $sort
*/
protected function addTimestampWhereRange( $field, $dir, $start, $end, $sort = true ) {
$db = $this->getDb();
@ -307,7 +307,7 @@ abstract class ApiQueryBase extends ApiBase {
/**
* Estimate the row count for the SELECT query that would be run if we
* called select() right now, and check if it's acceptable.
* @return bool true if acceptable, false otherwise
* @return bool True if acceptable, false otherwise
*/
protected function checkRowCount() {
$db = $this->getDB();
@ -333,7 +333,7 @@ abstract class ApiQueryBase extends ApiBase {
* Add information (title and namespace) about a Title object to a
* result array
* @param array $arr Result array à la ApiResult
* @param $title Title
* @param Title $title
* @param string $prefix Module prefix
*/
public static function addTitleInfo( &$arr, $title, $prefix = '' ) {
@ -344,7 +344,7 @@ abstract class ApiQueryBase extends ApiBase {
/**
* Override this method to request extra fields from the pageSet
* using $pageSet->requestField('fieldName')
* @param $pageSet ApiPageSet
* @param ApiPageSet $pageSet
*/
public function requestExtraData( $pageSet ) {
}
@ -485,7 +485,7 @@ abstract class ApiQueryBase extends ApiBase {
* namespace. It is advisable to pass the namespace parameter in order to
* handle per-namespace capitalization settings.
* @param string $titlePart Title part with spaces
* @param $defaultNamespace int Namespace to assume
* @param int $defaultNamespace Namespace to assume
* @return string Title part with underscores
*/
public function titlePartToKey( $titlePart, $defaultNamespace = NS_MAIN ) {
@ -530,8 +530,8 @@ abstract class ApiQueryBase extends ApiBase {
}
/**
* @param $query String
* @param $protocol String
* @param string $query
* @param string $protocol
* @return null|string
*/
public function prepareUrlQuerySearchString( $query = null, $protocol = null ) {
@ -582,7 +582,7 @@ abstract class ApiQueryBase extends ApiBase {
}
/**
* @param $hash string
* @param string $hash
* @return bool
*/
public function validateSha1Hash( $hash ) {
@ -590,7 +590,7 @@ abstract class ApiQueryBase extends ApiBase {
}
/**
* @param $hash string
* @param string $hash
* @return bool
*/
public function validateSha1Base36Hash( $hash ) {
@ -631,7 +631,7 @@ abstract class ApiQueryGeneratorBase extends ApiQueryBase {
* Switch this module to generator mode. By default, generator mode is
* switched off and the module acts like a normal query module.
* @since 1.21 requires pageset parameter
* @param $generatorPageSet ApiPageSet object that the module will get
* @param ApiPageSet $generatorPageSet ApiPageSet object that the module will get
* by calling getPageSet() when in generator mode.
*/
public function setGeneratorMode( ApiPageSet $generatorPageSet ) {
@ -684,8 +684,7 @@ abstract class ApiQueryGeneratorBase extends ApiQueryBase {
/**
* Execute this module as a generator
* @param $resultPageSet ApiPageSet: All output should be appended to
* this object
* @param ApiPageSet $resultPageSet All output should be appended to this object
*/
abstract public function executeGenerator( $resultPageSet );
}

View file

@ -32,7 +32,7 @@
class ApiQueryBlocks extends ApiQueryBase {
/**
* @var Array
* @var array
*/
protected $usernames;

View file

@ -48,7 +48,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
*/
private function run( $resultPageSet = null ) {
if ( $this->getPageSet()->getGoodTitleCount() == 0 ) {

View file

@ -48,7 +48,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -46,7 +46,7 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -44,7 +44,7 @@ class ApiQueryIWBacklinks extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
public function run( $resultPageSet = null ) {

View file

@ -222,7 +222,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
/**
* From parameters, construct a 'scale' array
* @param array $params Parameters passed to api.
* @return Array or Null: key-val array of 'width' and 'height', or null
* @return array|null Key-val array of 'width' and 'height', or null
*/
public function getScale( $params ) {
$p = $this->getModulePrefix();
@ -251,9 +251,9 @@ class ApiQueryImageInfo extends ApiQueryBase {
* We do this later than getScale, since we need the image
* to know which handler, since handlers can make their own parameters.
* @param File $image Image that params are for.
* @param array $thumbParams thumbnail parameters from getScale
* @param string $otherParams of otherParams (iiurlparam).
* @return Array of parameters for transform.
* @param array $thumbParams Thumbnail parameters from getScale
* @param string $otherParams String of otherParams (iiurlparam).
* @return array Array of parameters for transform.
*/
protected function mergeThumbParams( $image, $thumbParams, $otherParams ) {
global $wgThumbLimits;
@ -315,17 +315,17 @@ class ApiQueryImageInfo extends ApiQueryBase {
/**
* Get result information for an image revision
*
* @param $file File object
* @param array $prop of properties to get (in the keys)
* @param $result ApiResult object
* @param array $thumbParams containing 'width' and 'height' items, or null
* @param File $file
* @param array $prop Array of properties to get (in the keys)
* @param ApiResult $result
* @param array $thumbParams Containing 'width' and 'height' items, or null
* @param array|bool|string $opts Options for data fetching.
* This is an array consisting of the keys:
* 'version': The metadata version for the metadata option
* 'language': The language for extmetadata property
* 'multilang': Return all translations in extmetadata property
* 'revdelUser': User to use when checking whether to show revision-deleted fields.
* @return Array: result array
* @return array Result array
*/
static function getInfo( $file, $prop, $result, $thumbParams = null, $opts = false ) {
global $wgContLang;
@ -536,7 +536,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
*
* If this is >= TRANSFORM_LIMIT, you should probably stop processing images.
*
* @return integer count
* @return int count
*/
static function getTransformCount() {
return self::$transformCount;
@ -544,9 +544,9 @@ class ApiQueryImageInfo extends ApiQueryBase {
/**
*
* @param $metadata Array
* @param $result ApiResult
* @return Array
* @param array $metadata
* @param ApiResult $result
* @return array
*/
public static function processMetaData( $metadata, $result ) {
$retval = array();
@ -575,7 +575,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
}
/**
* @param $img File
* @param File $img
* @param null|string $start
* @return string
*/
@ -647,7 +647,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
*
* @param array $filter List of properties to filter out
*
* @return Array
* @return array
*/
public static function getPropertyNames( $filter = array() ) {
return array_diff( array_keys( self::getProperties() ), $filter );
@ -705,7 +705,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
/**
* Return the API documentation for the parameters.
* @return Array parameter documentation.
* @return array Parameter documentation.
*/
public function getParamDescription() {
$p = $this->getModulePrefix();

View file

@ -45,7 +45,7 @@ class ApiQueryImages extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
*/
private function run( $resultPageSet = null ) {
if ( $this->getPageSet()->getGoodTitleCount() == 0 ) {

View file

@ -53,7 +53,7 @@ class ApiQueryInfo extends ApiQueryBase {
}
/**
* @param $pageSet ApiPageSet
* @param ApiPageSet $pageSet
* @return void
*/
public function requestExtraData( $pageSet ) {
@ -80,7 +80,7 @@ class ApiQueryInfo extends ApiQueryBase {
* Get an array mapping token names to their handler functions.
* The prototype for a token function is func($pageid, $title)
* it should return a token or false (permission denied)
* @return array array(tokenname => function)
* @return array Array(tokenname => function)
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
@ -345,7 +345,7 @@ class ApiQueryInfo extends ApiQueryBase {
/**
* Get a result array with information about a title
* @param int $pageid Page ID (negative for missing titles)
* @param $title Title object
* @param Title $title
* @return array
*/
private function extractPageInfo( $pageid, $title ) {

View file

@ -44,7 +44,7 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
public function run( $resultPageSet = null ) {

View file

@ -236,13 +236,13 @@ class ApiQueryLogEvents extends ApiQueryBase {
}
/**
* @param $result ApiResult
* @param $vals array
* @param $params string
* @param $type string
* @param $action string
* @param $ts
* @param $legacy bool
* @param ApiResult $result
* @param array $vals
* @param string $params
* @param string $type
* @param string $action
* @param string $ts
* @param bool $legacy
* @return array
*/
public static function addLogParams( $result, &$vals, $params, $type,

View file

@ -104,9 +104,9 @@ class ApiQueryPageProps extends ApiQueryBase {
* Add page properties to an ApiResult, adding a continue
* parameter if it doesn't fit.
*
* @param $result ApiResult
* @param $page int
* @param $props array
* @param ApiResult $result
* @param int $page
* @param array $props
* @return bool True if it fits in the result
*/
private function addPageProps( $result, $page, $props ) {

View file

@ -49,7 +49,7 @@ class ApiQueryPagesWithProp extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -36,7 +36,7 @@ class ApiQueryPrefixSearch extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
*/
private function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();

View file

@ -44,7 +44,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -53,7 +53,7 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
*/
public function run( $resultPageSet = null ) {
global $wgQueryCacheLimit;

View file

@ -46,11 +46,11 @@ class ApiQueryRandom extends ApiQueryGeneratorBase {
}
/**
* @param $randstr
* @param $limit
* @param $namespace
* @param $resultPageSet ApiPageSet
* @param $redirect
* @param string $randstr
* @param int $limit
* @param int $namespace
* @param ApiPageSet $resultPageSet
* @param bool $redirect
* @return void
*/
protected function prepareQuery( $randstr, $limit, $namespace, &$resultPageSet, $redirect ) {
@ -68,7 +68,7 @@ class ApiQueryRandom extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return int
*/
protected function runQuery( $resultPageSet = null ) {
@ -99,7 +99,7 @@ class ApiQueryRandom extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
public function run( $resultPageSet = null ) {

View file

@ -69,9 +69,9 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
}
/**
* @param $pageid
* @param $title
* @param $rc RecentChange (optional)
* @param int $pageid
* @param Title $title
* @param RecentChange|null $rc
* @return bool|string
*/
public static function getPatrolToken( $pageid, $title, $rc = null ) {
@ -135,7 +135,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
/**
* Generates and outputs the result of this query based upon the provided parameters.
*
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
*/
public function run( $resultPageSet = null ) {
$user = $this->getUser();

View file

@ -45,7 +45,7 @@ class ApiQueryRedirects extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
*/
private function run( ApiPageSet $resultPageSet = null ) {
$db = $this->getDB();

View file

@ -72,10 +72,10 @@ class ApiQueryRevisions extends ApiQueryBase {
}
/**
* @param $pageid
* @param $title Title
* @param $rev Revision
* @return bool|String
* @param int $pageid
* @param Title $title
* @param Revision $rev
* @return bool|string
*/
public static function getRollbackToken( $pageid, $title, $rev ) {
global $wgUser;

View file

@ -52,7 +52,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -108,7 +108,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
/**
* Return the API documentation for the parameters.
* @return Array parameter documentation.
* @return array Parameter documentation.
*/
public function getParamDescription() {
$p = $this->getModulePrefix();

View file

@ -130,7 +130,7 @@ class ApiQueryContributions extends ApiQueryBase {
* Validate the 'user' parameter and set the value to compare
* against `revision`.`rev_user_text`
*
* @param $user string
* @param string $user
*/
private function prepareUsername( $user ) {
if ( !is_null( $user ) && $user !== '' ) {
@ -326,7 +326,7 @@ class ApiQueryContributions extends ApiQueryBase {
/**
* Extract fields from the database row and append them to a result array
*
* @param $row
* @param mixed $row
* @return array
*/
private function extractRowInfo( $row ) {

View file

@ -41,7 +41,7 @@ class ApiQueryUsers extends ApiQueryBase {
* Get an array mapping token names to their handler functions.
* The prototype for a token function is func($user)
* it should return a token or false (permission denied)
* @return Array tokenname => function
* @return array Array of tokenname => function
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
@ -63,8 +63,8 @@ class ApiQueryUsers extends ApiQueryBase {
}
/**
* @param $user User
* @return String
* @param User $user
* @return string
*/
public static function getUserrightsToken( $user ) {
global $wgUser;
@ -261,7 +261,7 @@ class ApiQueryUsers extends ApiQueryBase {
* Gets all the groups that a user is automatically a member of (implicit groups)
*
* @deprecated since 1.20; call User::getAutomaticGroups() directly.
* @param $user User
* @param User $user
* @return array
*/
public static function getAutoGroups( $user ) {

View file

@ -51,7 +51,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
$fld_loginfo = false;
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -45,7 +45,7 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
}
/**
* @param $resultPageSet ApiPageSet
* @param ApiPageSet $resultPageSet
* @return void
*/
private function run( $resultPageSet = null ) {

View file

@ -60,7 +60,7 @@ class ApiResult extends ApiBase {
/**
* Constructor
* @param $main ApiMain object
* @param ApiMain $main
*/
public function __construct( $main ) {
parent::__construct( $main, 'result' );
@ -106,7 +106,7 @@ class ApiResult extends ApiBase {
/**
* Get the 'real' size of a result item. This means the strlen() of the item,
* or the sum of the strlen()s of the elements if the item is an array.
* @param $value mixed
* @param mixed $value
* @return int
*/
public static function size( $value ) {
@ -150,9 +150,9 @@ class ApiResult extends ApiBase {
/**
* Add an output value to the array by name.
* Verifies that value with the same name has not been added before.
* @param array $arr to add $value to
* @param array $arr To add $value to
* @param string $name Index of $arr to add $value at
* @param $value mixed
* @param mixed $value
* @param int $flags Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP.
* This parameter used to be boolean, and the value of OVERRIDE=1 was
* specifically chosen so that it would be backwards compatible with the
@ -192,9 +192,9 @@ class ApiResult extends ApiBase {
/**
* Adds a content element to an array.
* Use this function instead of hardcoding the '*' element.
* @param array $arr to add the content element to
* @param $value Mixed
* @param string $subElemName when present, content element is created
* @param array $arr To add the content element to
* @param mixed $value
* @param string $subElemName When present, content element is created
* as a sub item of $arr. Use this parameter to create elements in
* format "<elem>text</elem>" without attributes.
*/
@ -216,7 +216,7 @@ class ApiResult extends ApiBase {
* In case the array contains indexed values (in addition to named),
* give all indexed values the given tag name. This function MUST be
* called on every array that has numerical indexes.
* @param $arr array
* @param array $arr
* @param string $tag Tag name
*/
public function setIndexedTagName( &$arr, $tag ) {
@ -233,7 +233,7 @@ class ApiResult extends ApiBase {
/**
* Calls setIndexedTagName() on each sub-array of $arr
* @param $arr array
* @param array $arr
* @param string $tag Tag name
*/
public function setIndexedTagName_recursive( &$arr, $tag ) {
@ -254,7 +254,7 @@ class ApiResult extends ApiBase {
* Don't specify a path to a value that's not in the result, or
* you'll get nasty errors.
* @param array $path Path to the array, like addValue()'s $path
* @param $tag string
* @param string $tag
*/
public function setIndexedTagName_internal( $path, $tag ) {
$data = &$this->mData;
@ -277,9 +277,9 @@ class ApiResult extends ApiBase {
* If $path is null, the value will be inserted at the data root.
* If $name is empty, the $value is added as a next list element data[] = $value.
*
* @param $path array|string|null
* @param $name string
* @param $value mixed
* @param array|string|null $path
* @param string $name
* @param mixed $value
* @param int $flags Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. This
* parameter used to be boolean, and the value of OVERRIDE=1 was specifically
* chosen so that it would be backwards compatible with the new method
@ -340,8 +340,8 @@ class ApiResult extends ApiBase {
/**
* Add a parsed limit=max to the result.
*
* @param $moduleName string
* @param $limit int
* @param string $moduleName
* @param int $limit
*/
public function setParsedLimit( $moduleName, $limit ) {
// Add value, allowing overwriting
@ -352,8 +352,8 @@ class ApiResult extends ApiBase {
* Unset a value previously added to the result set.
* Fails silently if the value isn't found.
* For parameters, see addValue()
* @param $path array|null
* @param $name string
* @param array|null $path
* @param string $name
*/
public function unsetValue( $path, $name ) {
$data = &$this->mData;
@ -379,7 +379,7 @@ class ApiResult extends ApiBase {
/**
* Callback function for cleanUpUTF8()
*
* @param $s string
* @param string $s
*/
private static function cleanUp_helper( &$s ) {
if ( !is_string( $s ) ) {

View file

@ -275,7 +275,7 @@ class ApiUpload extends ApiBase {
* Stash the file and return the file key
* Also re-raises exceptions with slightly more informative message strings (useful for API)
* @throws MWException
* @return String file key
* @return string File key
*/
private function performStash() {
try {
@ -446,7 +446,7 @@ class ApiUpload extends ApiBase {
/**
* Checks that the user has permissions to perform this upload.
* Dies with usage message on inadequate permissions.
* @param $user User The user to check.
* @param User $user The user to check.
*/
protected function checkPermissions( $user ) {
// Check whether the user has the appropriate permissions to upload anyway