jenkins-bot has submitted this change and it was merged.
Change subject: Use short array syntax instead of array()
..
Use short array syntax instead of array()
Change-Id: I22f24bf047ff8bb476000bfbf879cc7612c10c27
---
M includes/CookieWarning.hooks.php
M tests/phpunit/includes/CookieWarning.hooksTest.php
2 files changed, 31 insertions(+), 31 deletions(-)
Approvals:
Florianschmidtwelzow: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/CookieWarning.hooks.php b/includes/CookieWarning.hooks.php
index 5da906c..de1150f 100644
--- a/includes/CookieWarning.hooks.php
+++ b/includes/CookieWarning.hooks.php
@@ -52,7 +52,7 @@
if ( $moreLink ) {
$moreLink = Html::element(
'a',
- array( 'href' => $moreLink ),
+ [ 'href' => $moreLink ],
$sk->msg( 'cookiewarning-moreinfo-label'
)->text()
);
}
@@ -62,25 +62,25 @@
}
$tpl->data['headelement'] .= Html::openElement(
'div',
- array( 'class' => 'mw-cookiewarning-container' )
+ [ 'class' => 'mw-cookiewarning-container' ]
) .
Html::openElement(
'div',
- array( 'class' => 'mw-cookiewarning-text' )
+ [ 'class' => 'mw-cookiewarning-text' ]
) .
Html::element(
'span',
- array(),
+ [],
$sk->msg( 'cookiewarning-info' )->text()
) .
$moreLink .
- Html::openElement( 'form', array( 'method' => 'POST' )
) .
+ Html::openElement( 'form', [ 'method' => 'POST' ] ) .
Html::submitButton(
$sk->msg( 'cookiewarning-ok-label' )->text(),
- array(
+ [
'name' => 'disablecookiewarning',
'class' => 'mw-cookiewarning-dismiss'
- )
+ ]
) .
Html::closeElement( 'form' ) .
Html::closeElement( 'div' ) .
@@ -122,8 +122,8 @@
*/
public static function onBeforePageDisplay( OutputPage $out ) {
if ( self::showWarning( $out->getContext() ) ) {
- $out->addModuleStyles( array(
'ext.CookieWarning.styles' ) );
- $out->addModules( array( 'ext.CookieWarning' ) );
+ $out->addModuleStyles( [ 'ext.CookieWarning.styles' ] );
+ $out->addModules( [ 'ext.CookieWarning' ] );
}
}
@@ -160,10 +160,10 @@
* @return bool
*/
public static function onGetPreferences( User $user,
&$defaultPreferences ) {
- $defaultPreferences['cookiewarning_dismissed'] = array(
+ $defaultPreferences['cookiewarning_dismissed'] = [
'type' => 'api',
'default' => '0',
- );
+ ];
return true;
}
}
diff --git a/tests/phpunit/includes/CookieWarning.hooksTest.php
b/tests/phpunit/includes/CookieWarning.hooksTest.php
index 9c30103..f2d9ae9 100644
--- a/tests/phpunit/includes/CookieWarning.hooksTest.php
+++ b/tests/phpunit/includes/CookieWarning.hooksTest.php
@@ -14,10 +14,10 @@
public function testOnSkinTemplateOutputPageBeforeExec( $enabled,
$morelinkConfig,
$morelinkCookieWarningMsg, $morelinkCookiePolicyMsg,
$expectedLink
) {
- $this->setMwGlobals( array(
+ $this->setMwGlobals( [
'wgCookieWarningEnabled' => $enabled,
'wgCookieWarningMoreUrl' => $morelinkConfig,
- ) );
+ ] );
if ( $morelinkCookieWarningMsg ) {
$title = Title::newFromText( 'cookiewarning-more-link',
NS_MEDIAWIKI );
$wikiPage = WikiPage::factory( $title );
@@ -50,8 +50,8 @@
}
public function providerOnSkinTemplateOutputPageBeforeExec() {
- return array(
- array(
+ return [
+ [
// $wgCookieWarningEnabled
true,
// $wgCookieWarningMoreUrl
@@ -62,58 +62,58 @@