aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorumherirrender <umherirrender_de.wp@web.de>2016-03-11 18:41:26 +0100
committerumherirrender <umherirrender_de.wp@web.de>2016-03-11 18:41:26 +0100
commit8678e32b8db50b57178a173ac60e4da3fd89f57c (patch)
tree134a0b4aacf54f445c2d915b3ada370a51cb7e2a /includes
parent989feebb73352d690adbdc7a94fce8245cb78882 (diff)
downloadmediawikicore-8678e32b8db50b57178a173ac60e4da3fd89f57c.tar.gz
mediawikicore-8678e32b8db50b57178a173ac60e4da3fd89f57c.zip
Change remaining places to use short array syntax
Change-Id: I0785c73a239c11188ad7411c5cd8ed09a2dbc9b3
Diffstat (limited to 'includes')
-rw-r--r--includes/GitInfo.php10
-rw-r--r--includes/changetags/ChangeTagsLogItem.php6
-rw-r--r--includes/content/TextContentHandler.php2
-rw-r--r--includes/diff/DifferenceEngine.php8
-rw-r--r--includes/revisiondelete/RevDelLogItem.php42
-rw-r--r--includes/templates/Usercreate.php32
-rw-r--r--includes/templates/Userlogin.php28
7 files changed, 64 insertions, 64 deletions
diff --git a/includes/GitInfo.php b/includes/GitInfo.php
index 14f3cc14afee..29516ab7cd94 100644
--- a/includes/GitInfo.php
+++ b/includes/GitInfo.php
@@ -43,7 +43,7 @@ class GitInfo {
/**
* Cached git information.
*/
- protected $cache = array();
+ protected $cache = [];
/**
* Map of repo URLs to viewer URLs. Access via static method getViewers().
@@ -215,7 +215,7 @@ class GitInfo {
is_executable( $wgGitBin ) &&
$this->getHead() !== false
) {
- $environment = array( "GIT_DIR" => $this->basedir );
+ $environment = [ "GIT_DIR" => $this->basedir ];
$cmd = wfEscapeShellArg( $wgGitBin ) .
" show -s --format=format:%ct HEAD";
$retc = false;
@@ -265,11 +265,11 @@ class GitInfo {
if ( preg_match( $pattern, $url, $matches ) ) {
$viewerUrl = preg_replace( $pattern, $viewer, $url );
$headSHA1 = $this->getHeadSHA1();
- $replacements = array(
+ $replacements = [
'%h' => substr( $headSHA1, 0, 7 ),
'%H' => $headSHA1,
'%r' => urlencode( $matches[1] ),
- );
+ ];
return strtr( $viewerUrl, $replacements );
}
}
@@ -396,7 +396,7 @@ class GitInfo {
if ( self::$viewers === false ) {
self::$viewers = $wgGitRepositoryViewers;
- Hooks::run( 'GitViewers', array( &self::$viewers ) );
+ Hooks::run( 'GitViewers', [ &self::$viewers ] );
}
return self::$viewers;
diff --git a/includes/changetags/ChangeTagsLogItem.php b/includes/changetags/ChangeTagsLogItem.php
index 24bded7498ea..2dc953c360bf 100644
--- a/includes/changetags/ChangeTagsLogItem.php
+++ b/includes/changetags/ChangeTagsLogItem.php
@@ -73,8 +73,8 @@ class ChangeTagsLogItem extends RevisionItemBase {
$loglink = Linker::link(
SpecialPage::getTitleFor( 'Log' ),
$this->list->msg( 'log' )->escaped(),
- array(),
- array( 'page' => $title->getPrefixedText() )
+ [],
+ [ 'page' => $title->getPrefixedText() ]
);
$loglink = $this->list->msg( 'parentheses' )->rawParams( $loglink )->escaped();
// User links and action text
@@ -88,7 +88,7 @@ class ChangeTagsLogItem extends RevisionItemBase {
}
$content = "$loglink $date $action $comment";
- $attribs = array();
+ $attribs = [];
$tags = $this->getTags();
if ( $tags ) {
list( $tagSummary, $classes ) = ChangeTags::formatSummaryRow(
diff --git a/includes/content/TextContentHandler.php b/includes/content/TextContentHandler.php
index f5e87830ca33..ad40cd907797 100644
--- a/includes/content/TextContentHandler.php
+++ b/includes/content/TextContentHandler.php
@@ -32,7 +32,7 @@ class TextContentHandler extends ContentHandler {
// @codingStandardsIgnoreStart bug 57585
public function __construct( $modelId = CONTENT_MODEL_TEXT,
- $formats = array( CONTENT_FORMAT_TEXT ) ) {
+ $formats = [ CONTENT_FORMAT_TEXT ] ) {
parent::__construct( $modelId, $formats );
}
// @codingStandardsIgnoreEnd
diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php
index a1a1bb049717..44e6a245c378 100644
--- a/includes/diff/DifferenceEngine.php
+++ b/includes/diff/DifferenceEngine.php
@@ -573,7 +573,7 @@ class DifferenceEngine extends ContextSource {
<h2 class='diff-currentversion-title'>{$revHeader}</h2>\n" );
# Page content may be handled by a hooked call instead...
# @codingStandardsIgnoreStart Ignoring long lines.
- if ( Hooks::run( 'ArticleContentOnDiff', array( $this, $out ) ) ) {
+ if ( Hooks::run( 'ArticleContentOnDiff', [ $this, $out ] ) ) {
$this->loadNewText();
$out->setRevisionId( $this->mNewid );
$out->setRevisionTimestamp( $this->mNewRev->getTimestamp() );
@@ -584,7 +584,7 @@ class DifferenceEngine extends ContextSource {
// This needs to be synchronised with Article::showCssOrJsPage(), which sucks
// Give hooks a chance to customise the output
// @todo standardize this crap into one function
- if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
+ if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', [ $this->mNewContent, $this->mNewPage, $out ] ) ) {
// NOTE: deprecated hook, B/C only
// use the content object's own rendering
$cnt = $this->mNewRev->getContent();
@@ -593,9 +593,9 @@ class DifferenceEngine extends ContextSource {
$out->addParserOutputContent( $po );
}
}
- } elseif ( !Hooks::run( 'ArticleContentViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
+ } elseif ( !Hooks::run( 'ArticleContentViewCustom', [ $this->mNewContent, $this->mNewPage, $out ] ) ) {
// Handled by extension
- } elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
+ } elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom', [ $this->mNewContent, $this->mNewPage, $out ] ) ) {
// NOTE: deprecated hook, B/C only
// Handled by extension
} else {
diff --git a/includes/revisiondelete/RevDelLogItem.php b/includes/revisiondelete/RevDelLogItem.php
index 65b03097425b..1ea72715a594 100644
--- a/includes/revisiondelete/RevDelLogItem.php
+++ b/includes/revisiondelete/RevDelLogItem.php
@@ -55,11 +55,11 @@ class RevDelLogItem extends RevDelItem {
$dbw = wfGetDB( DB_MASTER );
$dbw->update( 'logging',
- array( 'log_deleted' => $bits ),
- array(
+ [ 'log_deleted' => $bits ],
+ [
'log_id' => $this->row->log_id,
'log_deleted' => $this->getBits() // cas
- ),
+ ],
__METHOD__
);
@@ -69,14 +69,14 @@ class RevDelLogItem extends RevDelItem {
}
$dbw->update( 'recentchanges',
- array(
+ [
'rc_deleted' => $bits,
'rc_patrolled' => 1
- ),
- array(
+ ],
+ [
'rc_logid' => $this->row->log_id,
'rc_timestamp' => $this->row->log_timestamp // index
- ),
+ ],
__METHOD__
);
@@ -95,8 +95,8 @@ class RevDelLogItem extends RevDelItem {
$loglink = Linker::link(
SpecialPage::getTitleFor( 'Log' ),
$this->list->msg( 'log' )->escaped(),
- array(),
- array( 'page' => $title->getPrefixedText() )
+ [],
+ [ 'page' => $title->getPrefixedText() ]
);
$loglink = $this->list->msg( 'parentheses' )->rawParams( $loglink )->escaped();
// User links and action text
@@ -115,34 +115,34 @@ class RevDelLogItem extends RevDelItem {
public function getApiData( ApiResult $result ) {
$logEntry = DatabaseLogEntry::newFromRow( $this->row );
$user = $this->list->getUser();
- $ret = array(
+ $ret = [
'id' => $logEntry->getId(),
'type' => $logEntry->getType(),
'action' => $logEntry->getSubtype(),
- );
+ ];
$ret += $logEntry->isDeleted( LogPage::DELETED_USER )
- ? array( 'userhidden' => '' )
- : array();
+ ? [ 'userhidden' => '' ]
+ : [];
$ret += $logEntry->isDeleted( LogPage::DELETED_COMMENT )
- ? array( 'commenthidden' => '' )
- : array();
+ ? [ 'commenthidden' => '' ]
+ : [];
$ret += $logEntry->isDeleted( LogPage::DELETED_ACTION )
- ? array( 'actionhidden' => '' )
- : array();
+ ? [ 'actionhidden' => '' ]
+ : [];
if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
$ret['params'] = LogFormatter::newFromEntry( $logEntry )->formatParametersForApi();
}
if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
- $ret += array(
+ $ret += [
'userid' => $this->row->log_user,
'user' => $this->row->log_user_text,
- );
+ ];
}
if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
- $ret += array(
+ $ret += [
'comment' => $this->row->log_comment,
- );
+ ];
}
return $ret;
diff --git a/includes/templates/Usercreate.php b/includes/templates/Usercreate.php
index a39690a72c9e..3824be1251d4 100644
--- a/includes/templates/Usercreate.php
+++ b/includes/templates/Usercreate.php
@@ -28,13 +28,13 @@ class UsercreateTemplate extends BaseTemplate {
* UserCreateForm hook to add checkboxes to the create account form.
*/
function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
- $this->data['extraInput'][] = array(
+ $this->data['extraInput'][] = [
'name' => $name,
'value' => $value,
'type' => $type,
'msg' => $msg,
'helptext' => $helptext,
- );
+ ];
}
function execute() {
@@ -84,7 +84,7 @@ class UsercreateTemplate extends BaseTemplate {
<span class="mw-ui-flush-right"><?php echo $this->getMsg( 'createacct-helpusername' )->parse(); ?></span>
</label>
<?php
- echo Html::input( 'wpName', $this->data['name'], 'text', array(
+ echo Html::input( 'wpName', $this->data['name'], 'text', [
'class' => 'mw-ui-input loginText',
'id' => 'wpName2',
'tabindex' => '1',
@@ -92,7 +92,7 @@ class UsercreateTemplate extends BaseTemplate {
'required',
'placeholder' => $this->getMsg( $this->data['loggedin'] ?
'createacct-another-username-ph' : 'userlogin-yourname-ph' )->text(),
- ) );
+ ] );
?>
</div>
@@ -113,14 +113,14 @@ class UsercreateTemplate extends BaseTemplate {
<div class="mw-ui-vform-field mw-row-password">
<label for='wpPassword2'><?php $this->msg( 'userlogin-yourpassword' ); ?></label>
<?php
- echo Html::input( 'wpPassword', null, 'password', array(
+ echo Html::input( 'wpPassword', null, 'password', [
'class' => 'mw-ui-input loginPassword',
'id' => 'wpPassword2',
'tabindex' => '3',
'size' => '20',
'required',
'placeholder' => $this->getMsg( 'createacct-yourpassword-ph' )->text()
- ) + User::passwordChangeInputAttribs() );
+ ] + User::passwordChangeInputAttribs() );
?>
</div>
@@ -143,14 +143,14 @@ class UsercreateTemplate extends BaseTemplate {
<div class="mw-ui-vform-field mw-row-password">
<label for='wpRetype'><?php $this->msg( 'createacct-yourpasswordagain' ); ?></label>
<?php
- echo Html::input( 'wpRetype', null, 'password', array(
+ echo Html::input( 'wpRetype', null, 'password', [
'class' => 'mw-ui-input loginPassword',
'id' => 'wpRetype',
'tabindex' => '5',
'size' => '20',
'required',
'placeholder' => $this->getMsg( 'createacct-yourpasswordagain-ph' )->text()
- ) + User::passwordChangeInputAttribs() );
+ ] + User::passwordChangeInputAttribs() );
?>
</div>
@@ -165,7 +165,7 @@ class UsercreateTemplate extends BaseTemplate {
?>
</label>
<?php
- echo Html::input( 'wpEmail', $this->data['email'], 'email', array(
+ echo Html::input( 'wpEmail', $this->data['email'], 'email', [
'class' => 'mw-ui-input loginText',
'id' => 'wpEmail',
'tabindex' => '6',
@@ -173,7 +173,7 @@ class UsercreateTemplate extends BaseTemplate {
'required' => $this->data['emailrequired'],
'placeholder' => $this->getMsg( $this->data['loggedin'] ?
'createacct-another-email-ph' : 'createacct-email-ph' )->text()
- ) );
+ ] );
?>
<?php } ?>
</div>
@@ -193,13 +193,13 @@ class UsercreateTemplate extends BaseTemplate {
<?php if ( $this->data['usereason'] ) { ?>
<div class="mw-ui-vform-field">
<label for='wpReason'><?php $this->msg( 'createacct-reason' ); ?></label>
- <?php echo Html::input( 'wpReason', $this->data['reason'], 'text', array(
+ <?php echo Html::input( 'wpReason', $this->data['reason'], 'text', [
'class' => 'mw-ui-input loginText',
'id' => 'wpReason',
'tabindex' => '8',
'size' => '20',
'placeholder' => $this->getMsg( 'createacct-reason-ph' )->text()
- ) ); ?>
+ ] ); ?>
</div>
<?php } ?>
@@ -265,15 +265,15 @@ class UsercreateTemplate extends BaseTemplate {
<?php
echo Html::submitButton(
$this->getMsg( $this->data['loggedin'] ? 'createacct-another-submit' : 'createacct-submit' ),
- array(
+ [
'id' => 'wpCreateaccount',
'name' => 'wpCreateaccount',
'tabindex' => $tabIndex++
- ),
- array(
+ ],
+ [
'mw-ui-block',
'mw-ui-constructive',
- )
+ ]
);
?>
</div>
diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php
index f19c0f2b7588..c2b2df6f2f6d 100644
--- a/includes/templates/Userlogin.php
+++ b/includes/templates/Userlogin.php
@@ -67,15 +67,15 @@ class UserloginTemplate extends BaseTemplate {
$this->msg( 'userlogin-yourname' );
if ( $this->data['secureLoginUrl'] ) {
- echo Html::element( 'a', array(
+ echo Html::element( 'a', [
'href' => $this->data['secureLoginUrl'],
'class' => 'mw-ui-flush-right mw-secure',
- ), $this->getMsg( 'userlogin-signwithsecure' )->text() );
+ ], $this->getMsg( 'userlogin-signwithsecure' )->text() );
}
?>
</label>
<?php
- echo Html::input( 'wpName', $this->data['name'], 'text', array(
+ echo Html::input( 'wpName', $this->data['name'], 'text', [
'class' => 'loginText mw-ui-input',
'id' => 'wpName1',
'tabindex' => '1',
@@ -85,7 +85,7 @@ class UserloginTemplate extends BaseTemplate {
// Set focus to this field if it's blank.
'autofocus' => !$this->data['name'],
'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text()
- ) );
+ ] );
?>
</div>
@@ -96,14 +96,14 @@ class UserloginTemplate extends BaseTemplate {
?>
</label>
<?php
- echo Html::input( 'wpPassword', null, 'password', array(
+ echo Html::input( 'wpPassword', null, 'password', [
'class' => 'loginPassword mw-ui-input',
'id' => 'wpPassword1',
'tabindex' => '2',
// Set focus to this field if username is filled in.
'autofocus' => (bool)$this->data['name'],
'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text()
- ) );
+ ] );
?>
</div>
@@ -142,14 +142,14 @@ class UserloginTemplate extends BaseTemplate {
<div class="mw-ui-vform-field">
<?php
- $attrs = array(
+ $attrs = [
'id' => 'wpLoginAttempt',
'name' => 'wpLoginAttempt',
'tabindex' => '6',
- );
- $modifiers = array(
+ ];
+ $modifiers = [
'mw-ui-progressive',
- );
+ ];
echo Html::submitButton( $this->getMsg( 'pt-login-button' )->text(), $attrs, $modifiers );
?>
</div>
@@ -158,11 +158,11 @@ class UserloginTemplate extends BaseTemplate {
<?php
echo Html::element(
'a',
- array(
+ [
'href' => Skin::makeInternalOrExternalUrl(
wfMessage( 'helplogin-url' )->inContentLanguage()->text()
),
- ),
+ ],
$this->getMsg( 'userlogin-helplink2' )->text()
);
?>
@@ -172,9 +172,9 @@ class UserloginTemplate extends BaseTemplate {
if ( $this->data['useemail'] && $this->data['canreset'] && $this->data['resetlink'] === true ) {
echo Html::rawElement(
'div',
- array(
+ [
'class' => 'mw-ui-vform-field mw-form-related-link-container',
- ),
+ ],
Linker::link(
SpecialPage::getTitleFor( 'PasswordReset' ),
$this->getMsg( 'userlogin-resetpassword-link' )->escaped()