[MediaWiki-commits] [Gerrit] mediawiki...CookieWarning[master]: Use short array syntax instead of array()

2016-09-17 Thread jenkins-bot (Code Review)
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 @@

[MediaWiki-commits] [Gerrit] mediawiki...CookieWarning[master]: Use short array syntax instead of array()

2016-09-14 Thread Florianschmidtwelzow (Code Review)
Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/310566

Change subject: Use short array syntax instead of array()
..

Use short array syntax instead of array()

Change-Id: I22f24bf047ff8bb476000bfbf879cc7612c10c27
---
M includes/CookieWarning.hooks.php
1 file changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CookieWarning 
refs/changes/66/310566/1

diff --git a/includes/CookieWarning.hooks.php b/includes/CookieWarning.hooks.php
index 5b054b5..c8d9a00 100644
--- a/includes/CookieWarning.hooks.php
+++ b/includes/CookieWarning.hooks.php
@@ -55,32 +55,32 @@
if ( $conf->get( 'CookieWarningMoreUrl' ) ) {
$moreLink = Html::element(
'a',
-   array( 'href' => $conf->get( 
'CookieWarningMoreUrl' ) ),
+   [ 'href' => $conf->get( 'CookieWarningMoreUrl' 
) ],
$sk->msg( 'cookiewarning-moreinfo-label' 
)->text()
);
}
 
$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' ) .
@@ -96,8 +96,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' ] );
}
}
 
@@ -134,10 +134,10 @@
 * @return bool
 */
public static function onGetPreferences( User $user, 
&$defaultPreferences ) {
-   $defaultPreferences['cookiewarning_dismissed'] = array(
+   $defaultPreferences['cookiewarning_dismissed'] = [
'type' => 'api',
'default' => '0',
-   );
+   ];
return true;
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/310566
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I22f24bf047ff8bb476000bfbf879cc7612c10c27
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CookieWarning
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits