$this->mode = "post";
}
- switch( $this->mode ) {
+ switch ( $this->mode ) {
case 'get':
$this->func_name = isset( $_GET["rs"] ) ? $_GET["rs"] : '';
if ( ! empty( $_GET["rsargs"] ) ) {
$page = null;
wfRunHooks( 'ArticleFromTitle', array( &$title, &$page ) );
if ( !$page ) {
- switch( $title->getNamespace() ) {
+ switch ( $title->getNamespace() ) {
case NS_FILE:
$page = new ImagePage( $title );
break;
$this->mParserOutput = false;
while ( !$outputDone && ++$pass ) {
- switch( $pass ) {
+ switch ( $pass ) {
case 1:
wfRunHooks( 'ArticleViewHeader', array( &$this, &$outputDone, &$useParserCache ) );
break;
$user = User::newFromName( $rootPart, false /* allow IP users*/ );
$ip = User::isIP( $rootPart );
- if ( !($user && $user->isLoggedIn()) && !$ip ) { # User does not exist
+ if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist
$outputPage->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n\$1\n</div>",
array( 'userpage-userdoesnotexist-view', wfEscapeWikiText( $rootPart ) ) );
} elseif ( $user->isBlocked() ) { # Show log extract if the user is currently blocked
return false;
}
- switch( $cond[0] ) {
+ switch ( $cond[0] ) {
case APCOND_EMAILCONFIRMED:
if ( Sanitizer::validateEmail( $user->getEmail() ) ) {
if ( $wgEmailAuthentication ) {
# passed by some callers (bug 29116)
if ( $vagueTarget != '' ) {
list( $target, $type ) = self::parseTarget( $vagueTarget );
- switch( $type ) {
+ switch ( $type ) {
case self::TYPE_USER:
# Slightly weird, but who are we to argue?
$conds['ipb_address'][] = (string)$target;
* @return Array
*/
protected function getDatabaseArray( $db = null ) {
- if( !$db ) {
+ if ( !$db ) {
$db = wfGetDB( DB_SLAVE );
}
$expiry = $db->encodeExpiry( $this->mExpiry );
* @return String IP in Hex form
*/
public function getRangeStart() {
- switch( $this->type ) {
+ switch ( $this->type ) {
case self::TYPE_USER:
return '';
case self::TYPE_IP:
* @return String IP in Hex form
*/
public function getRangeEnd() {
- switch( $this->type ) {
+ switch ( $this->type ) {
case self::TYPE_USER:
return '';
case self::TYPE_IP:
* @return Bool
*/
public function prevents( $action, $x = null ) {
- switch( $action ) {
+ switch ( $action ) {
case 'edit':
# For now... <evil laugh>
return true;
* @param Array $block Array of blocks
* @return Block|null the "best" block from the list
*/
- public static function chooseBlock( array $blocks, array $ipChain ) {
+ public static function chooseBlock( array $blocks, array $ipChain ) {
if ( !count( $blocks ) ) {
return null;
} elseif ( count( $blocks ) == 1 ) {
$default = $this->options[$name]['default'];
$type = $this->options[$name]['type'];
- switch( $type ) {
+ switch ( $type ) {
case self::BOOL:
$value = $r->getBool( $name, $default );
break;
}
$last = $string[strlen( $string ) - 1];
$val = intval( $string );
- switch( $last ) {
+ switch ( $last ) {
case 'g':
case 'G':
$val *= 1024;
' Http::$httpEngine is set to "curl"' );
}
- switch( Http::$httpEngine ) {
+ switch ( Http::$httpEngine ) {
case 'curl':
return new CurlHttpRequest( $url, $options );
case 'php':
}
$buffer = "";
while ( $this->reader->read() ) {
- switch( $this->reader->nodeType ) {
+ switch ( $this->reader->nodeType ) {
case XmlReader::TEXT:
case XmlReader::SIGNIFICANT_WHITESPACE:
$buffer .= $this->reader->value;
$lookup = array();
foreach ( $xmlReaderConstants as $name ) {
- $lookup[constant("XmlReader::$name")] = $name;
+ $lookup[constant( "XmlReader::$name" )] = $name;
}
}
}
$buffer = "";
while ( $this->read() ) {
- switch( $this->nodeType ) {
+ switch ( $this->nodeType ) {
case XmlReader::TEXT:
case XmlReader::SIGNIFICANT_WHITESPACE:
$buffer .= $this->value;
return Status::newFatal( 'importnofile' );
}
if ( !empty( $upload['error'] ) ) {
- switch( $upload['error'] ) {
+ switch ( $upload['error'] ) {
case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini.
return Status::newFatal( 'importuploaderrorsize' );
case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
}
/* Look for WebP */
- if ( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8), "WEBPVP8 ", 8 ) == 0 ) {
+ if ( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8 ), "WEBPVP8 ", 8 ) == 0 ) {
wfDebug( __METHOD__ . ": recognized file as image/webp\n" );
return "image/webp";
}
}
wfDebug( __METHOD__ . ": detected an Open Packaging Conventions archive: $mime\n" );
} elseif ( substr( $header, 0, 8 ) == "\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1" &&
- ($headerpos = strpos( $tail, "PK\x03\x04" ) ) !== false &&
+ ( $headerpos = strpos( $tail, "PK\x03\x04" ) ) !== false &&
preg_match( $openxmlRegex, substr( $tail, $headerpos + 30 ) ) ) {
if ( substr( $header, 512, 4 ) == "\xEC\xA5\xC1\x00" ) {
$mime = "application/msword";
}
- switch( substr( $header, 512, 6 ) ) {
+ switch ( substr( $header, 512, 6 ) ) {
case "\xEC\xA5\xC1\x00\x0E\x00":
case "\xEC\xA5\xC1\x00\x1C\x00":
case "\xEC\xA5\xC1\x00\x43\x00":
if ( $title->isTalkPage() ) {
$link = $title->getSubjectPage();
- switch( $link->getNamespace() ) {
+ switch ( $link->getNamespace() ) {
case NS_MAIN:
$text = wfMessage( 'articlepage' );
break;
}
function makeSearchButton( $mode, $attrs = array() ) {
- switch( $mode ) {
+ switch ( $mode ) {
case 'go':
case 'fulltext':
$realAttrs = array(
*/
public function getTalkNsText() {
global $wgContLang;
- return( $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) ) );
+ return $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) );
}
/**
* @return Bool TRUE or FALSE
*/
public function canTalk() {
- return( MWNamespace::canTalk( $this->mNamespace ) );
+ return MWNamespace::canTalk( $this->mNamespace );
}
/**
*/
public function getSubpageText() {
if ( !MWNamespace::hasSubpages( $this->mNamespace ) ) {
- return( $this->mTextform );
+ return $this->mTextform;
}
$parts = explode( '/', $this->mTextform );
- return( $parts[count( $parts ) - 1] );
+ return $parts[count( $parts ) - 1];
}
/**
public function getSubpageUrlForm() {
$text = $this->getSubpageText();
$text = wfUrlencode( str_replace( ' ', '_', $text ) );
- return( $text );
+ return $text;
}
/**
return true; // any interwiki link might be viewable, for all we know
}
- switch( $this->mNamespace ) {
+ switch ( $this->mNamespace ) {
case NS_MEDIA:
case NS_FILE:
// file exists, possibly in a foreign repo
$requestArray['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
}
- if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) ) {
+ if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) ) {
$requestArray['wpMinoredit'] = '';
}
$wgRequest = $oldRequest;
global $wgMaxArticleSize;
- switch( $status->value ) {
+ switch ( $status->value ) {
case EditPage::AS_HOOK_ERROR:
case EditPage::AS_HOOK_ERROR_EXPECTED:
$this->dieUsageMsg( 'hookaborted' );
unset( $elemValue[$subElemId] );
} elseif ( is_array( $subElemValue ) ) {
$subElements[$subElemId] = $subElemValue;
- unset ( $elemValue[$subElemId] );
+ unset( $elemValue[$subElemId] );
}
}
if ( !$isDryRun ) {
// Populate page information with the original user input
- switch( $dataSource ) {
+ switch ( $dataSource ) {
case 'titles':
$this->initFromTitles( $this->mParams['titles'] );
break;
* @return array of raw_prefixed_title (string) => prefixed_title (string)
* @since 1.21
*/
- public function getNormalizedTitlesAsResult( $result = null ) {
+ public function getNormalizedTitlesAsResult( $result = null ) {
$values = array();
foreach ( $this->getNormalizedTitles() as $rawTitleStr => $titleStr ) {
$values[] = array(
}
return $retval;
}
- switch( $type ) {
+ switch ( $type ) {
case 'edit':
return RC_EDIT;
case 'new':
global $wgFileExtensions;
// @todo Move them to ApiBase's message map
- switch( $verification['status'] ) {
+ switch ( $verification['status'] ) {
// Recoverable errors
case UploadBase::MIN_LENGTH_PARTNAME:
$this->dieRecoverableError( 'filename-tooshort', 'filename' );
$arrNum[] = $value;
}
}
- switch( $mode ) {
+ switch ( $mode ) {
case SQLSRV_FETCH_ASSOC:
$ret = $this->mRows[$this->mCursor];
break;
Using uppercase because that's the only way Oracle can handle
quoted tablenames
*/
- switch( $name ) {
+ switch ( $name ) {
case 'user':
$name = 'MWUSER';
break;
function tableName( $name, $format = 'quoted' ) {
# Replace reserved words with better ones
- switch( $name ) {
+ switch ( $name ) {
case 'user':
return $this->realTableName( 'mwuser', $format );
case 'text':
$newline = 1;
$retval = array();
foreach ( $diff->edits as $edit ) {
- switch( $edit->type ) {
+ switch ( $edit->type ) {
case 'add':
foreach ( $edit->closing as $l ) {
$retval[] = array(
}
}
- switch( $this->values['wgMainCacheType'] ) {
+ switch ( $this->values['wgMainCacheType'] ) {
case 'anything':
case 'db':
case 'memcached':
// Text of title the action is aimed at.
$target = $entry->getTarget()->getPrefixedText();
$text = null;
- switch( $entry->getType() ) {
+ switch ( $entry->getType() ) {
case 'move':
- switch( $entry->getSubtype() ) {
+ switch ( $entry->getSubtype() ) {
case 'move':
$movesource = $parameters['4::target'];
$text = wfMessage( '1movedto2' )
break;
case 'delete':
- switch( $entry->getSubtype() ) {
+ switch ( $entry->getSubtype() ) {
case 'delete':
$text = wfMessage( 'deletedarticle' )
->rawParams( $target )->inContentLanguage()->escaped();
break;
case 'protect':
- switch( $entry->getSubtype() ) {
+ switch ( $entry->getSubtype() ) {
case 'protect':
$text = wfMessage( 'protectedarticle' )
->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
break;
case 'newusers':
- switch( $entry->getSubtype() ) {
+ switch ( $entry->getSubtype() ) {
case 'newusers':
case 'create':
$text = wfMessage( 'newuserlog-create-entry' )
break;
case 'upload':
- switch( $entry->getSubtype() ) {
+ switch ( $entry->getSubtype() ) {
case 'upload':
$text = wfMessage( 'uploadedimage' )
->rawParams( $target )->inContentLanguage()->escaped();
} else {
$newgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
}
- switch( $entry->getSubtype() ) {
+ switch ( $entry->getSubtype() ) {
case 'rights':
$text = wfMessage( 'rightslogentry' )
->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
protected function formatParameterValue( $type, $value ) {
$saveLinkFlood = $this->linkFlood;
- switch( strtolower( trim( $type ) ) ) {
+ switch ( strtolower( trim( $type ) ) ) {
case 'raw':
$value = Message::rawParam( $value );
break;
return $title->getPrefixedText();
}
- switch( $type ) {
+ switch ( $type ) {
case 'move':
$titleLink = Linker::link(
$title,
$head = fread( $fh, 2 );
fclose( $fh );
- switch( $head ) {
+ switch ( $head ) {
case 'II':
return 'LE'; // II for intel.
case 'MM':
foreach ( $vals as &$val ) {
- switch( $tag ) {
+ switch ( $tag ) {
case 'Compression':
- switch( $val ) {
+ switch ( $val ) {
case 1: case 2: case 3: case 4:
case 5: case 6: case 7: case 8:
case 32773: case 32946: case 34712:
break;
case 'PhotometricInterpretation':
- switch( $val ) {
+ switch ( $val ) {
case 2: case 6:
$val = self::msg( $tag, $val );
break;
break;
case 'Orientation':
- switch( $val ) {
+ switch ( $val ) {
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
$val = self::msg( $tag, $val );
break;
break;
case 'PlanarConfiguration':
- switch( $val ) {
+ switch ( $val ) {
case 1: case 2:
$val = self::msg( $tag, $val );
break;
case 'XResolution':
case 'YResolution':
- switch( $resolutionunit ) {
+ switch ( $resolutionunit ) {
case 2:
$val = self::msg( 'XYResolution', 'i', self::formatNum( $val ) );
break;
break;
case 'ColorSpace':
- switch( $val ) {
+ switch ( $val ) {
case 1: case 65535:
$val = self::msg( $tag, $val );
break;
break;
case 'ComponentsConfiguration':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6:
$val = self::msg( $tag, $val );
break;
break;
case 'ExposureProgram':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
$val = self::msg( $tag, $val );
break;
break;
case 'MeteringMode':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 255:
$val = self::msg( $tag, $val );
break;
break;
case 'LightSource':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2: case 3: case 4: case 9: case 10: case 11:
case 12: case 13: case 14: case 15: case 17: case 18: case 19: case 20:
case 21: case 22: case 23: case 24: case 255:
break;
case 'FocalPlaneResolutionUnit':
- switch( $val ) {
+ switch ( $val ) {
case 2:
$val = self::msg( $tag, $val );
break;
break;
case 'SensingMethod':
- switch( $val ) {
+ switch ( $val ) {
case 1: case 2: case 3: case 4: case 5: case 7: case 8:
$val = self::msg( $tag, $val );
break;
break;
case 'FileSource':
- switch( $val ) {
+ switch ( $val ) {
case 3:
$val = self::msg( $tag, $val );
break;
break;
case 'SceneType':
- switch( $val ) {
+ switch ( $val ) {
case 1:
$val = self::msg( $tag, $val );
break;
break;
case 'CustomRendered':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1:
$val = self::msg( $tag, $val );
break;
break;
case 'ExposureMode':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2:
$val = self::msg( $tag, $val );
break;
break;
case 'WhiteBalance':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1:
$val = self::msg( $tag, $val );
break;
break;
case 'SceneCaptureType':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2: case 3:
$val = self::msg( $tag, $val );
break;
break;
case 'GainControl':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2: case 3: case 4:
$val = self::msg( $tag, $val );
break;
break;
case 'Contrast':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2:
$val = self::msg( $tag, $val );
break;
break;
case 'Saturation':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2:
$val = self::msg( $tag, $val );
break;
break;
case 'Sharpness':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2:
$val = self::msg( $tag, $val );
break;
break;
case 'SubjectDistanceRange':
- switch( $val ) {
+ switch ( $val ) {
case 0: case 1: case 2: case 3:
$val = self::msg( $tag, $val );
break;
//The GPS...Ref values are kept for compatibility, probably won't be reached.
case 'GPSLatitudeRef':
case 'GPSDestLatitudeRef':
- switch( $val ) {
+ switch ( $val ) {
case 'N': case 'S':
$val = self::msg( 'GPSLatitude', $val );
break;
case 'GPSLongitudeRef':
case 'GPSDestLongitudeRef':
- switch( $val ) {
+ switch ( $val ) {
case 'E': case 'W':
$val = self::msg( 'GPSLongitude', $val );
break;
break;
case 'GPSStatus':
- switch( $val ) {
+ switch ( $val ) {
case 'A': case 'V':
$val = self::msg( $tag, $val );
break;
break;
case 'GPSMeasureMode':
- switch( $val ) {
+ switch ( $val ) {
case 2: case 3:
$val = self::msg( $tag, $val );
break;
case 'GPSTrackRef':
case 'GPSImgDirectionRef':
case 'GPSDestBearingRef':
- switch( $val ) {
+ switch ( $val ) {
case 'T': case 'M':
$val = self::msg( 'GPSDirection', $val );
break;
break;
case 'GPSSpeedRef':
- switch( $val ) {
+ switch ( $val ) {
case 'K': case 'M': case 'N':
$val = self::msg( 'GPSSpeed', $val );
break;
break;
case 'GPSDestDistanceRef':
- switch( $val ) {
+ switch ( $val ) {
case 'K': case 'M': case 'N':
$val = self::msg( 'GPSDestDistance', $val );
break;
break;
case 'iimCategory':
- switch( strtolower( $val ) ) {
+ switch ( strtolower( $val ) ) {
// See pg 29 of IPTC photo
// metadata standard.
case 'ace': case 'clj':
}
break;
case 'Copyrighted':
- switch( $val ) {
+ switch ( $val ) {
case 'True': case 'False':
$val = self::msg( $tag, $val );
break;
*/
else {
global $wgContLang;
- switch( $type ) {
+ switch ( $type ) {
case 'lang':
// Display default, followed by ContLang,
// followed by the rest in no particular
* this is treated as wikitext not html).
*/
private static function langItem( $value, $lang, $default = false, $noHtml = false ) {
- if ( $lang === false && $default === false) {
+ if ( $lang === false && $default === false ) {
throw new MWException( '$lang and $default cannot both '
. 'be false.' );
}
return $val;
}
$cat = '';
- switch( substr( $val, 0, 2 ) ) {
+ switch ( substr( $val, 0, 2 ) ) {
case '01':
$cat = 'ace';
break;
wfDebugLog( 'iptc', "IPTC tag $tag had only whitespace as its value." );
continue;
}
- switch( $tag ) {
+ switch ( $tag ) {
case '2#120': /*IPTC caption. mapped with exif ImageDescription*/
$data['ImageDescription'] = self::convIPTC( $val, $c );
break;
while ( $keepReading ) {
$tag = $this->reader->localName;
$type = $this->reader->nodeType;
- $isSVG = ($this->reader->namespaceURI == self::NS_SVG);
+ $isSVG = ( $this->reader->namespaceURI == self::NS_SVG );
$this->debug( "$tag" );
&& $this->reader->nodeType == XmlReader::END_ELEMENT ) {
break;
} elseif ( $this->reader->namespaceURI == self::NS_SVG && $this->reader->nodeType == XmlReader::ELEMENT ) {
- switch( $this->reader->localName ) {
+ switch ( $this->reader->localName ) {
case 'script':
// Normally we disallow files with
// <script>, but its possible
throw new MWException( "Hit end element </$elm> but no curItem" );
}
- switch( $this->mode[0] ) {
+ switch ( $this->mode[0] ) {
case self::MODE_IGNORE:
$this->endElementModeIgnore( $elm );
break;
. "encountered <$elm> with no mode" );
}
- switch( $this->mode[0] ) {
+ switch ( $this->mode[0] ) {
case self::MODE_IGNORE:
$this->startElementModeIgnore( $elm );
break;
if ( is_null( $magicWords ) ) {
$magicWords = new MagicWordArray( array( 'url_path', 'url_query', 'url_wiki' ) );
}
- switch( $magicWords->matchStartToEnd( $arg ) ) {
+ switch ( $magicWords->matchStartToEnd( $arg ) ) {
// Encode as though it's a wiki page, '_' for ' '.
case 'url_wiki':
static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
return self::formatRaw( SiteStats::pagesInNs( intval( $namespace ) ), $raw );
}
- static function numberingroup( $parser, $name = '', $raw = null) {
+ static function numberingroup( $parser, $name = '', $raw = null ) {
return self::formatRaw( SiteStats::numberingroup( strtolower( $name ) ), $raw );
}
if ( $old === false || $old == $text || $arg ) {
return '';
} else {
- return( '<span class="error">' .
+ return '<span class="error">' .
wfMessage( 'duplicate-defaultsort', $old, $text )->inContentLanguage()->escaped() .
- '</span>' );
+ '</span>';
}
}
for ( $i = 0; $i < $len; $i++ ) {
$c = $str[$i];
- switch( $state ) {
+ switch ( $state ) {
# (Using the number is a performance hack for common cases)
case 0: # self::COLON_STATE_TEXT:
- switch( $c ) {
+ switch ( $c ) {
case "<":
# Could be either a <start> tag or an </end> tag
$state = self::COLON_STATE_TAGSTART;
break;
case 1: # self::COLON_STATE_TAG:
# In a <tag>
- switch( $c ) {
+ switch ( $c ) {
case ">":
$stack++;
$state = self::COLON_STATE_TEXT;
}
break;
case 2: # self::COLON_STATE_TAGSTART:
- switch( $c ) {
+ switch ( $c ) {
case "/":
$state = self::COLON_STATE_CLOSETAG;
break;
* @return mixed An expanded string, or false if invalid.
*/
function validateSig( $text ) {
- return( Xml::isWellFormedXmlFragment( $text ) ? $text : false );
+ return Xml::isWellFormedXmlFragment( $text ) ? $text : false;
}
/**
$validated = $handler->validateParam( $paramName, $value );
} else {
# Validate internal parameters
- switch( $paramName ) {
+ switch ( $paramName ) {
case 'manualthumb':
case 'alt':
case 'class':
* @return Boolean
*/
public function supports( $feature ) {
- switch( $feature ) {
+ switch ( $feature ) {
case 'list-redirects':
return true;
case 'title-suffix-filter':
}
public function supports( $feature ) {
- switch( $feature ) {
+ switch ( $feature ) {
case 'list-redirects':
case 'title-suffix-filter':
return true;
$form->addPreText( $this->msg( 'unblockiptext' )->parseAsBlock() );
if ( $form->show() ) {
- switch( $this->type ) {
+ switch ( $this->type ) {
case Block::TYPE_USER:
case Block::TYPE_IP:
$out->addWikiMsg( 'unblocked', wfEscapeWikiText( $this->target ) );
} else {
$fields['Target']['default'] = $target;
$fields['Target']['type'] = 'hidden';
- switch( $type ) {
+ switch ( $type ) {
case Block::TYPE_USER:
case Block::TYPE_IP:
$fields['Name']['default'] = Linker::link(
protected function processVerificationError( $details ) {
global $wgFileExtensions;
- switch( $details['status'] ) {
+ switch ( $details['status'] ) {
/** Statuses that only require name changing **/
case UploadBase::MIN_LENGTH_PARTNAME:
$mode = SpecialEditWatchlist::getMode( $request, $par );
if ( $mode !== false ) {
# TODO: localise?
- switch( $mode ) {
+ switch ( $mode ) {
case SpecialEditWatchlist::EDIT_CLEAR:
$mode = 'clear';
break;
$big = 1000; /* The magical big */
if ( $nitems > $big ) {
# Set default cutoff shorter
- $values['days'] = $defaults['days'] = (12.0 / 24.0); # 12 hours...
+ $values['days'] = $defaults['days'] = ( 12.0 / 24.0 ); # 12 hours...
} else {
$values['days'] = $defaults['days']; # default cutoff for shortlisters
}
}
$start = substr( $str, 0, strlen( $str ) - 2 );
$end = substr( $str, strlen( $str ) - 2 );
- switch( $end ) {
+ switch ( $end ) {
case 'כ':
$str = $start . 'ך';
break;
global $wgLanguageCode;
$text = parent::translate( $text, $toVariant );
- switch( $toVariant ) {
+ switch ( $toVariant ) {
case 'kk-cyrl':
case 'kk-kz':
$letters = KK_L_UC . KK_L_LC . 'ʺʹ#0123456789';
return $text;
}
- switch( $toVariant ) {
+ switch ( $toVariant ) {
case 'kk-arab':
case 'kk-cn':
$letters = KK_C_LC . KK_C_UC/*.KK_L_LC.KK_L_UC*/;
$matches = array();
if ( preg_match( '/^--(.+?)(?:=(.+?)(?::(.+?))?)?$/', $arg, $matches ) ) {
@list( /* $full */ , $opt, $val, $param ) = $matches;
- switch( $opt ) {
+ switch ( $opt ) {
case "plugin":
$this->loadPlugin( $val, $param );
break;
function fatalError( $msg ) {
$this->progress( "$msg\n" );
- die(1);
+ die( 1 );
}
}
$this->infiles = explode( ';', $infile );
$this->reader = new XMLReader();
$infile = array_shift( $this->infiles );
- if (defined( 'LIBXML_PARSEHUGE' ) ) {
+ if ( defined( 'LIBXML_PARSEHUGE' ) ) {
$this->reader->open( $infile, null, LIBXML_PARSEHUGE );
}
else {
}
} else {
$this->close();
- if (count($this->infiles)) {
- $infile = array_shift($this->infiles);
+ if ( count( $this->infiles ) ) {
+ $infile = array_shift( $this->infiles );
$this->reader->open( $infile );
$this->atEnd = false;
}
}
$buffer = "";
while ( $this->reader->read() ) {
- switch( $this->reader->nodeType ) {
+ switch ( $this->reader->nodeType ) {
case XMLReader::TEXT:
// case XMLReader::WHITESPACE:
case XMLReader::SIGNIFICANT_WHITESPACE:
global $IP;
$url = $this->processFileOpt( $val, $param );
- switch( $opt ) {
+ switch ( $opt ) {
case 'prefetch':
require_once "$IP/maintenance/backupPrefetch.inc";
$this->prefetch = new BaseDump( $url );
function processFileOpt( $val, $param ) {
$fileURIs = explode( ';', $param );
foreach ( $fileURIs as $URI ) {
- switch( $val ) {
+ switch ( $val ) {
case "file":
$newURI = $URI;
break;
}
$out = null;
- switch( $this->getOption( 'format' ) ) {
+ switch ( $this->getOption( 'format' ) ) {
case 'PHP':
$out = serialize( $res );
break;
public function __construct( array $options ) {
if ( isset( $options['help'] ) ) {
echo $this->help();
- exit(1);
+ exit( 1 );
}
if ( isset( $options['lang'] ) ) {
public function __construct( array $options, $extension ) {
if ( isset( $options['help'] ) ) {
echo $this->help();
- exit(1);
+ exit( 1 );
}
if ( isset( $options['lang'] ) ) {
echo $extension->name() . ":\n";
if ( $this->level > 0 ) {
- switch( $this->output ) {
+ switch ( $this->output ) {
case 'plain':
$this->outputText();
break;
unset( $file );
if ( is_array( $argv ) ) {
- for ($i = 0; $i < count($argv); $i++ ) {
- switch( $argv[$i] ) {
+ for ( $i = 0; $i < count( $argv ); $i++ ) {
+ switch ( $argv[$i] ) {
case '--all':
$input = 0;
break;
END;
- exit(0);
+ exit( 0 );
break;
}
}
<?php } ?>
<?php if ( $this->data['newtalk'] ) { ?>
<!-- newtalk -->
- <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
+ <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
<!-- /newtalk -->
<?php } ?>
<?php if ( $this->data['showjumplinks'] ) { ?>
}
echo "\n<!-- {$name} -->\n";
- switch( $name ) {
+ switch ( $name ) {
case 'SEARCH':
break;
case 'TOOLBOX':
// Render elements
foreach ( $elements as $name => $element ) {
echo "\n<!-- {$name} -->\n";
- switch( $element ) {
+ switch ( $element ) {
case 'NAMESPACES':
?>
<div id="p-namespaces" role="navigation" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>">
$this->assertEquals( $sinfo['userId'], $context->getUser()->getId(), "Correct context user ID." );
$this->assertEquals( 'UnitTestContextUser', $context->getUser()->getName(), "Correct context user name." );
- unset ( $sc ); // restore previous context
+ unset( $sc ); // restore previous context
$info = $context->exportSession();
$this->assertEquals( $oInfo['ip'], $info['ip'], "Correct initial IP address." );