From 6164423de0f34b5c264bacebb8371811e07fdaa8 Mon Sep 17 00:00:00 2001 From: Paladox Date: Fri, 6 May 2016 21:25:56 +0100 Subject: [PATCH] Update mediawiki/mediawiki-codesniffer to 0.7.1 This also fixes some code style errors. This also include a performance increase in running phpcs, performance increase was done by addshore :). Change-Id: I74a3d3134791ac22c332bb4fa0bc5c3662599394 --- composer.json | 2 +- includes/DefaultSettings.php | 4 +-- includes/DummyLinker.php | 30 +++++++++---------- includes/skins/Skin.php | 4 +-- includes/user/User.php | 2 +- .../includes/changes/RecentChangeTest.php | 2 +- .../includes/page/WikiCategoryPageTest.php | 4 +-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index 885a66b037..b614a4c1b0 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", "justinrainbow/json-schema": "~1.3", - "mediawiki/mediawiki-codesniffer": "0.6.0", + "mediawiki/mediawiki-codesniffer": "0.7.1", "monolog/monolog": "~1.18.2", "nikic/php-parser": "1.4.1", "nmred/kafka-php": "0.1.5", diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d65e0ad5ab..b7f487e4cb 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -7291,7 +7291,7 @@ $wgActionFilteredLogs = [ ], 'newusers' => [ 'create' => [ 'create', 'newusers' ], - 'create2' => ['create2' ], + 'create2' => [ 'create2' ], 'autocreate' => [ 'autocreate' ], 'byemail' => [ 'byemail' ], ], @@ -7303,7 +7303,7 @@ $wgActionFilteredLogs = [ 'protect' => [ 'protect' ], 'modify' => [ 'modify' ], 'unprotect' => [ 'unprotect' ], - 'move_prot' => ['move_prot'], + 'move_prot' => [ 'move_prot' ], ], 'rights' => [ 'rights' => [ 'rights' ], diff --git a/includes/DummyLinker.php b/includes/DummyLinker.php index 45535ceee5..6545c4aac5 100644 --- a/includes/DummyLinker.php +++ b/includes/DummyLinker.php @@ -54,9 +54,9 @@ class DummyLinker { public function link( $target, $html = null, - $customAttribs = [ ], - $query = [ ], - $options = [ ] + $customAttribs = [], + $query = [], + $options = [] ) { return Linker::link( $target, @@ -70,8 +70,8 @@ class DummyLinker { public function linkKnown( $target, $html = null, - $customAttribs = [ ], - $query = [ ], + $customAttribs = [], + $query = [], $options = [ 'known', 'noclasses' ] ) { return Linker::linkKnown( @@ -123,8 +123,8 @@ class DummyLinker { Parser $parser, Title $title, $file, - $frameParams = [ ], - $handlerParams = [ ], + $frameParams = [], + $handlerParams = [], $time = false, $query = "", $widthOption = null @@ -147,7 +147,7 @@ class DummyLinker { $label = '', $alt, $align = 'right', - $params = [ ], + $params = [], $framed = false, $manualthumb = "" ) { @@ -166,8 +166,8 @@ class DummyLinker { public function makeThumbLink2( Title $title, $file, - $frameParams = [ ], - $handlerParams = [ ], + $frameParams = [], + $handlerParams = [], $time = false, $query = "" ) { @@ -232,7 +232,7 @@ class DummyLinker { $text, $escape = true, $linktype = '', - $attribs = [ ], + $attribs = [], $title = null ) { return Linker::makeExternalLink( @@ -329,7 +329,7 @@ class DummyLinker { Title $title, $text, $wikiId = null, - $options = [ ] + $options = [] ) { return Linker::makeCommentLink( $title, @@ -471,7 +471,7 @@ class DummyLinker { return Linker::formatSize( $size ); } - public function titleAttrib( $name, $options = null, array $msgParams = [ ] ) { + public function titleAttrib( $name, $options = null, array $msgParams = [] ) { return Linker::titleAttrib( $name, $options, @@ -491,7 +491,7 @@ class DummyLinker { ); } - public function revDeleteLink( $query = [ ], $restricted = false, $delete = true ) { + public function revDeleteLink( $query = [], $restricted = false, $delete = true ) { return Linker::revDeleteLink( $query, $restricted, @@ -503,7 +503,7 @@ class DummyLinker { return Linker::revDeleteLinkDisabled( $delete ); } - public function tooltipAndAccesskeyAttribs( $name, array $msgParams = [ ] ) { + public function tooltipAndAccesskeyAttribs( $name, array $msgParams = [] ) { return Linker::tooltipAndAccesskeyAttribs( $name, $msgParams diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 97fffdabb5..d70a6b91da 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1589,8 +1589,8 @@ abstract class Skin extends ContextSource { public function linkKnown( $target, $html = null, - $customAttribs = [ ], - $query = [ ], + $customAttribs = [], + $query = [], $options = [ 'known', 'noclasses' ] ) { wfDeprecated( __METHOD__, '1.21' ); diff --git a/includes/user/User.php b/includes/user/User.php index 44d2b21c58..ee617a2caf 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -475,7 +475,7 @@ class User implements IDBAccessObject { */ protected static function getInProcessCache() { if ( !self::$inProcessCache ) { - self::$inProcessCache = new HashBagOStuff( ['maxKeys' => 10] ); + self::$inProcessCache = new HashBagOStuff( [ 'maxKeys' => 10 ] ); } return self::$inProcessCache; } diff --git a/tests/phpunit/includes/changes/RecentChangeTest.php b/tests/phpunit/includes/changes/RecentChangeTest.php index 2efc802cda..45f1382c47 100644 --- a/tests/phpunit/includes/changes/RecentChangeTest.php +++ b/tests/phpunit/includes/changes/RecentChangeTest.php @@ -161,7 +161,7 @@ class RecentChangeTest extends MediaWikiTestCase { $pageProps->expects( $this->once() ) ->method( 'getProperties' ) ->with( $categoryTitle, 'hiddencat' ) - ->will( $this->returnValue( $isHidden ? [ $categoryTitle->getArticleID() => '' ] : [ ] ) ); + ->will( $this->returnValue( $isHidden ? [ $categoryTitle->getArticleID() => '' ] : [] ) ); $scopedOverride = PageProps::overrideInstance( $pageProps ); diff --git a/tests/phpunit/includes/page/WikiCategoryPageTest.php b/tests/phpunit/includes/page/WikiCategoryPageTest.php index d6e1d9e0b8..9f4e1fabbb 100644 --- a/tests/phpunit/includes/page/WikiCategoryPageTest.php +++ b/tests/phpunit/includes/page/WikiCategoryPageTest.php @@ -22,7 +22,7 @@ class WikiCategoryPageTest extends MediaWikiLangTestCase { $pageProps->expects( $this->once() ) ->method( 'getProperties' ) ->with( $title, 'hiddencat' ) - ->will( $this->returnValue( [ ] ) ); + ->will( $this->returnValue( [] ) ); $scopedOverride = PageProps::overrideInstance( $pageProps ); @@ -50,7 +50,7 @@ class WikiCategoryPageTest extends MediaWikiLangTestCase { $pageProps->expects( $this->once() ) ->method( 'getProperties' ) ->with( $categoryTitle, 'hiddencat' ) - ->will( $this->returnValue( $isHidden ? [ $categoryTitle->getArticleID() => '' ] : [ ] ) ); + ->will( $this->returnValue( $isHidden ? [ $categoryTitle->getArticleID() => '' ] : [] ) ); $scopedOverride = PageProps::overrideInstance( $pageProps ); -- 2.20.1