if ( is_array( $type ) ) {
$choices = array();
$nothingPrompt = false;
- foreach ( $type as $t )
+ foreach ( $type as $t ) {
if ( $t === '' ) {
$nothingPrompt = 'Can be empty, or ';
} else {
$choices[] = $t;
}
+ }
$desc .= $paramPrefix . $nothingPrompt . $prompt . implode( ', ', $choices );
} else {
switch ( $type ) {
$value = wfTimestamp( TS_MW, $value );
break;
case 'user':
- if ( !is_array( $value ) ) $value = array( $value );
-
+ if ( !is_array( $value ) ) {
+ $value = array( $value );
+ }
+
foreach ( $value as $key => $val ) {
$title = Title::makeTitleSafe( NS_USER, $val );
if ( is_null( $title ) ) {
$value[$key] = $title->getText();
}
- if ( !$multi ) $value = $value[0];
-
- break;
+ if ( !$multi ) {
+ $value = $value[0];
+ }
+ break;
default:
ApiBase::dieDebug( __METHOD__, "Param $encParamName's type is unknown - $type" );
}
'userrights-nodatabase' => array( 'code' => 'nosuchdatabase', 'info' => "Database ``\$1'' does not exist or is not local" ),
'nouserspecified' => array( 'code' => 'invaliduser', 'info' => "Invalid username ``\$1''" ),
'noname' => array( 'code' => 'invaliduser', 'info' => "Invalid username ``\$1''" ),
- 'summaryrequired' => array( 'code' => 'summaryrequired', 'info' => 'Summary required'),
+ 'summaryrequired' => array( 'code' => 'summaryrequired', 'info' => 'Summary required' ),
// API-specific messages
'readrequired' => array( 'code' => 'readapidenied', 'info' => "You need read permission to use this module" ),
case EditPage::AS_SUCCESS_NEW_ARTICLE:
$r['new'] = '';
+
case EditPage::AS_SUCCESS_UPDATE:
$r['result'] = 'Success';
$r['pageid'] = intval( $titleObj->getArticleID() );
// This usually means some kind of race condition
// or DB weirdness occurred.
if ( is_array( $result ) && count( $result ) > 0 ) {
- $this->dieUsageMsg( array( 'unknownerror', $result[0][0] ) );
+ $this->dieUsageMsg( array( 'unknownerror', $result[0][0] ) );
}
// Unknown error, but no specific error message
array( 'code' => 'missingrev', 'info' => 'There is no revision ID oldid' ),
array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to view deleted revisions' ),
array( 'code' => 'missingtitle', 'info' => 'The page you specified doesn\'t exist' ),
- array( 'code' => 'nosuchsection', 'info' => 'There is no section sectionnumber in page'),
+ array( 'code' => 'nosuchsection', 'info' => 'There is no section sectionnumber in page' ),
array( 'nosuchpageid' ),
) );
}
$file['height'] = $row->fa_height;
$file['width'] = $row->fa_width;
}
- if ( $fld_description ){
+ if ( $fld_description ) {
$file['description'] = $row->fa_description;
}
- if ( $fld_metadata ){
+ if ( $fld_metadata ) {
$file['metadata'] = $row->fa_metadata ? ApiQueryImageInfo::processMetaData( unserialize( $row->fa_metadata ), $result ) : null;
}
- if ( $fld_bitdepth ){
+ if ( $fld_bitdepth ) {
$file['bitdepth'] = $row->fa_bits;
}
if ( $fld_mime ) {
}
public function getDescription() {
- return array('Find all pages that link to the given interwiki link.',
+ return array( 'Find all pages that link to the given interwiki link.',
'Can be used to find all links with a prefix, or',
'all links to a title (any prefix).',
'Using neither parameter is effectively "All IW Links"',
if ( $mto && !$mto->isError() ) {
$vals['thumburl'] = wfExpandUrl( $mto->getUrl() );
- //bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted
- //thumbnail sizes for the thumbnail actual size
+ // bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted
+ // thumbnail sizes for the thumbnail actual size
if ( $mto->getUrl() !== $file->getUrl() ) {
- $vals['thumbwidth'] = intval( $mto->getWidth() );
+ $vals['thumbwidth'] = intval( $mto->getWidth() );
$vals['thumbheight'] = intval( $mto->getHeight() );
} else {
- $vals['thumbwidth'] = intval( $file->getWidth() );
+ $vals['thumbwidth'] = intval( $file->getWidth() );
$vals['thumbheight'] = intval( $file->getHeight() );
}
$vals['pageid'] = intval( $row->page_id );
}
- if( $this->fld_title || $this->fld_parsedcomment ) {
+ if ( $this->fld_title || $this->fld_parsedcomment ) {
$title = Title::makeTitle( $row->log_namespace, $row->log_title );
}
}
if ( $this->fld_notificationtimestamp ) {
- $vals['notificationtimestamp'] = ( $row->wl_notificationtimestamp == null )
- ? ''
+ $vals['notificationtimestamp'] = ( $row->wl_notificationtimestamp == null )
+ ? ''
: wfTimestamp( TS_ISO_8601, $row->wl_notificationtimestamp );
}
$this->mParams['comment'],
$this->mParams['watchlist'],
$this->mParams['ignorewarnings'],
- $async);
+ $async );
$this->checkPermissions( $wgUser );
if ( $async ) {