* @param int $botMax Maximum value for sysops/bots
* @param bool $enforceLimits Whether to enforce (die) if value is outside limits
*/
- protected function validateLimit( $paramName, &$value, $min, $max, $botMax = null, $enforceLimits = false ) {
+ protected function validateLimit( $paramName, &$value, $min, $max, $botMax = null,
+ $enforceLimits = false
+ ) {
if ( !is_null( $min ) && $value < $min ) {
$msg = $this->encodeParamName( $paramName ) . " may not be less than $min (set to $value)";
$this->warnOrDie( $msg, $enforceLimits );
'createaccount-title',
'createaccount-text'
) );
- } elseif ( $this->getConfig()->get( 'EmailAuthentication' ) && Sanitizer::validateEmail( $user->getEmail() ) ) {
+ } elseif ( $this->getConfig()->get( 'EmailAuthentication' ) &&
+ Sanitizer::validateEmail( $user->getEmail() )
+ ) {
// Send out an email authentication message if needed
$status->merge( $user->sendConfirmationMail() );
}
}
$msg = wfMessage( 'Contributions' )->inContentLanguage()->text();
- $feedTitle = $config->get( 'Sitename' ) . ' - ' . $msg . ' [' . $config->get( 'LanguageCode' ) . ']';
+ $feedTitle = $config->get( 'Sitename' ) . ' - ' . $msg .
+ ' [' . $config->get( 'LanguageCode' ) . ']';
$feedUrl = SpecialPage::getTitleFor( 'Contributions', $params['user'] )->getFullURL();
$target = $params['user'] == 'newbies'
break;
default:
- $this->dieUsage( __METHOD__ . ': Unknown value for \'formatversion\'', 'unknownformatversion' );
+ $this->dieUsage( __METHOD__ .
+ ': Unknown value for \'formatversion\'', 'unknownformatversion' );
}
}
$data = $this->getResult()->getResultData( null, $transform );
$submodules[] = $manager->getModule( $name );
}
}
- $help['submodules'] .= self::getHelpInternal( $context, $submodules, $suboptions, $haveModules );
+ $help['submodules'] .= self::getHelpInternal(
+ $context,
+ $submodules,
+ $suboptions,
+ $haveModules
+ );
$numSubmodules = count( $submodules );
}
$response->header( "Access-Control-Allow-Origin: $originHeader" );
$response->header( 'Access-Control-Allow-Credentials: true' );
- $response->header( "Timing-Allow-Origin: $originHeader" ); # http://www.w3.org/TR/resource-timing/#timing-allow-origin
+ // http://www.w3.org/TR/resource-timing/#timing-allow-origin
+ $response->header( "Timing-Allow-Origin: $originHeader" );
if ( !$preflight ) {
- $response->header( 'Access-Control-Expose-Headers: MediaWiki-API-Error, Retry-After, X-Database-Lag' );
+ $response->header(
+ 'Access-Control-Expose-Headers: MediaWiki-API-Error, Retry-After, X-Database-Lag'
+ );
}
}
)
) {
$this->dieUsage(
- "The '{$module->encodeParamName( 'token' )}' parameter was found in the query string, but must be in the POST body",
+ "The '{$module->encodeParamName( 'token' )}' parameter was " .
+ 'found in the query string, but must be in the POST body',
'mustposttoken'
);
}
$instance = call_user_func( $factory, $this->mParent, $name );
if ( !$instance instanceof $class ) {
- throw new MWException( "The factory function for module $name did not return an instance of $class!" );
+ throw new MWException(
+ "The factory function for module $name did not return an instance of $class!"
+ );
}
} else {
// create instance from class name
private $mGoodTitles = array();
private $mMissingPages = array(); // [ns][dbkey] => fake page_id
private $mMissingTitles = array();
- private $mInvalidTitles = array(); // [fake_page_id] => array( 'title' => $title, 'invalidreason' => $reason )
+ /** @var array [fake_page_id] => array( 'title' => $title, 'invalidreason' => $reason ) */
+ private $mInvalidTitles = array();
private $mMissingPageIDs = array();
private $mRedirectTitles = array();
private $mSpecialTitles = array();
ApiBase::PARAM_DFLT => 'timestamp|url',
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_HELP_MSG => 'apihelp-query+imageinfo-param-prop',
- ApiBase::PARAM_HELP_MSG_PER_VALUE => ApiQueryImageInfo::getPropertyMessages( $this->propertyFilter ),
+ ApiBase::PARAM_HELP_MSG_PER_VALUE =>
+ ApiQueryImageInfo::getPropertyMessages( $this->propertyFilter ),
),
'prefix' => null,
'minsize' => array(
$this->addFields( 'ipb_deleted' );
if ( $showBlockInfo ) {
- $this->addFields( array( 'ipb_id', 'ipb_by', 'ipb_by_text', 'ipb_reason', 'ipb_expiry', 'ipb_timestamp' ) );
+ $this->addFields( array(
+ 'ipb_id',
+ 'ipb_by',
+ 'ipb_by_text',
+ 'ipb_reason',
+ 'ipb_expiry',
+ 'ipb_timestamp'
+ ) );
}
// Don't show hidden names
// in the actual normalised version, only if we can actually normalise them,
// so we use the functions scope to throw away the normalisations.
if ( !$h->normaliseParams( $image, $finalParams ) ) {
- $this->dieUsage( "Could not normalise image parameters for " . $image->getName(), "urlparamnormal" );
+ $this->dieUsage( 'Could not normalise image parameters for ' .
+ $image->getName(), 'urlparamnormal' );
}
}
*/
private function getAllowedLogActions() {
$config = $this->getConfig();
- return array_keys( array_merge( $config->get( 'LogActions' ), $config->get( 'LogActionsHandlers' ) ) );
+ return array_keys( array_merge(
+ $config->get( 'LogActions' ),
+ $config->get( 'LogActionsHandlers' )
+ ) );
}
public function getCacheMode( $params ) {
$end = null;
}
- list( $left, $continue ) = $this->runQuery( $resultPageSet, $params['limit'], $start, $startId, $end );
+ list( $left, $continue ) =
+ $this->runQuery( $resultPageSet, $params['limit'], $start, $startId, $end );
if ( $end === null && $continue === null ) {
// Wrap around. We do this even if $left === 0 for continuation
// (saving a DB query in this rare case probably isn't worth the
$vals['ratelimits'] = $this->getRateLimits();
}
- if ( isset( $this->prop['realname'] ) && !in_array( 'realname', $this->getConfig()->get( 'HiddenPrefs' ) ) ) {
+ if ( isset( $this->prop['realname'] ) &&
+ !in_array( 'realname', $this->getConfig()->get( 'HiddenPrefs' ) )
+ ) {
$vals['realname'] = $user->getRealName();
}
$this->mParams = $this->extractRequestParams();
$request = $this->getMain()->getRequest();
// Check if async mode is actually supported (jobs done in cli mode)
- $this->mParams['async'] = ( $this->mParams['async'] && $this->getConfig()->get( 'EnableAsyncUploads' ) );
+ $this->mParams['async'] = ( $this->mParams['async'] &&
+ $this->getConfig()->get( 'EnableAsyncUploads' ) );
// Add the uploaded file to the params array
$this->mParams['file'] = $request->getFileName( 'file' );
$this->mParams['chunk'] = $request->getFileName( 'chunk' );
switch ( $exceptionType ) {
case 'UploadStashFileNotFoundException':
- $this->dieUsage( 'Could not find the file in the stash: ' . $e->getMessage(), 'stashedfilenotfound' );
+ $this->dieUsage(
+ 'Could not find the file in the stash: ' . $e->getMessage(),
+ 'stashedfilenotfound'
+ );
break;
case 'UploadStashBadPathException':
- $this->dieUsage( 'File key of improper format or otherwise invalid: ' . $e->getMessage(), 'stashpathinvalid' );
+ $this->dieUsage(
+ 'File key of improper format or otherwise invalid: ' . $e->getMessage(),
+ 'stashpathinvalid'
+ );
break;
case 'UploadStashFileException':
- $this->dieUsage( 'Could not store upload in the stash: ' . $e->getMessage(), 'stashfilestorage' );
+ $this->dieUsage(
+ 'Could not store upload in the stash: ' . $e->getMessage(),
+ 'stashfilestorage'
+ );
break;
case 'UploadStashZeroLengthFileException':
- $this->dieUsage( 'File is of zero length, and could not be stored in the stash: ' . $e->getMessage(), 'stashzerolength' );
+ $this->dieUsage(
+ 'File is of zero length, and could not be stored in the stash: ' .
+ $e->getMessage(),
+ 'stashzerolength'
+ );
break;
case 'UploadStashNotLoggedInException':
$this->dieUsage( 'Not logged in: ' . $e->getMessage(), 'stashnotloggedin' );