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 @@ false, // expected cookie warning link (when string), nothing if false '', - ), - array( + ], + [ false, '', false, false, false, - ), - array( + ], + [ true, 'http://google.de', false, false, '<a href="http://google.de">More information</a>', - ), - array( + ], + [ true, '', 'http://google.de', false, '<a href="http://google.de">More information</a>', - ), - array( + ], + [ true, '', false, 'http://google.de', '<a href="http://google.de">More information</a>', - ), + ], // the config should be the used, if set (no matter if the messages are used or not) - array( + [ true, 'http://google.de', false, 'http://google123.de', '<a href="http://google.de">More information</a>', - ), - array( + ], + [ true, 'http://google.de', 'http://google1234.de', 'http://google123.de', '<a href="http://google.de">More information</a>', - ), - array( + ], + [ true, '', 'http://google.de', 'http://google123.de', '<a href="http://google.de">More information</a>', - ), - ); + ], + ]; } } -- To view, visit https://gerrit.wikimedia.org/r/310566 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22f24bf047ff8bb476000bfbf879cc7612c10c27 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CookieWarning Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits