Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Unify whitespace in array() functions
......................................................................

Unify whitespace in array() functions

This is an other step forward to enable more PHPCS sniffs. Again, this
patch focuses on a single thing. Again, I can not enable the relevant
PHPCS sniff at the moment because it would trigger much more errors and
would need a much, much bigger patch. I want this to be done in small
steps for the sake of a much easier review.

Change-Id: I038a0f4830397f058fcdf4e7e5a4266c195351de
---
M 
client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
M lib/resources/Resources.php
M lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php
M lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php
M repo/includes/ChangeDispatcher.php
M repo/includes/rdf/RdfVocabulary.php
M repo/tests/phpunit/includes/Diff/ClaimDifferenceTest.php
M repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
M repo/tests/phpunit/includes/LinkedData/HttpAcceptNegotiatorTest.php
M repo/tests/phpunit/includes/api/EditEntityTest.php
M repo/tests/phpunit/includes/api/GetEntitiesTest.php
M repo/tests/phpunit/includes/api/ItemByTitleHelperTest.php
M repo/tests/phpunit/includes/api/MergeItemsTest.php
M repo/tests/phpunit/includes/api/ModifyTermTestCase.php
M repo/tests/phpunit/includes/api/ResultBuilderTest.php
M repo/tests/phpunit/includes/api/SetAliasesTest.php
M repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
M view/tests/phpunit/ClaimHtmlGeneratorTest.php
18 files changed, 30 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/74/222574/1

diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
index 2d08b95..d3f6ee1 100644
--- 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
@@ -74,7 +74,7 @@
                                                'language' => 'ku-latn',
                                                'value' => 'Pisîk'
                                        ),
-                                       'ku-arab' => array (
+                                       'ku-arab' => array(
                                                'language' => 'ku-arab',
                                                'value' => 'پسیک',
                                                'source-language' => 'ku-latn',
diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php
index 1b5759b..9c85474 100644
--- a/lib/resources/Resources.php
+++ b/lib/resources/Resources.php
@@ -30,8 +30,6 @@
                        'scripts' => array(
                                'wikibase.js',
                        ),
-                       'dependencies' => array(
-                       ),
                ),
 
                'wikibase.buildErrorOutput' => $moduleTemplate + array(
diff --git 
a/lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php 
b/lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php
index 424d558..eb63c01 100644
--- 
a/lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php
+++ 
b/lib/tests/phpunit/formatters/FormatterLabelDescriptionLookupFactoryTest.php
@@ -124,7 +124,7 @@
                                ) ),
                        ),
                        'no options' => array(
-                               new FormatterOptions( array( ) ),
+                               new FormatterOptions( array() ),
                        ),
                );
        }
diff --git 
a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php 
b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php
index 4e71f93..de059b7 100644
--- a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php
+++ b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php
@@ -630,7 +630,7 @@
 
                return array(
                        'empty' => array(
-                               new FormatterOptions( array( ) ),
+                               new FormatterOptions( array() ),
                                'en', // determined in 
WikibaseValueFormatterBuildersTest::newBuilder()
                                'en'  // derived from language code
                        ),
diff --git a/repo/includes/ChangeDispatcher.php 
b/repo/includes/ChangeDispatcher.php
index 5a94659..64fe338 100644
--- a/repo/includes/ChangeDispatcher.php
+++ b/repo/includes/ChangeDispatcher.php
@@ -261,7 +261,7 @@
         * @param int $after:  The last change ID processed by a previous run. 
All changes returned
         *                     will have an ID greater than $after.
         *
-        * @return array ( $batch, $seen ), where $batch is a list of Change 
objects, and $seen
+        * @return array( $batch, $seen ), where $batch is a list of Change 
objects, and $seen
         *         if the ID of the last change considered for the batch (even 
if that was filtered out),
         *         for use as a continuation marker.
         */
@@ -346,7 +346,7 @@
         * @param Change[] $changes: The list of changes to filter.
         * @param int      $limit:   The max number of changes to return
         *
-        * @return array ( $batch, $seen ), where $batch is the filtered list 
of Change objects,
+        * @return array( $batch, $seen ), where $batch is the filtered list of 
Change objects,
         *         and $seen if the ID of the last change considered for the 
batch
         *         (even if that was filtered out), for use as a continuation 
marker.
         */
diff --git a/repo/includes/rdf/RdfVocabulary.php 
b/repo/includes/rdf/RdfVocabulary.php
index 7ed998d..5bc5d06 100644
--- a/repo/includes/rdf/RdfVocabulary.php
+++ b/repo/includes/rdf/RdfVocabulary.php
@@ -81,7 +81,7 @@
         *
         * @var array
         */
-       private $namespaces = array ();
+       private $namespaces = array();
 
        /**
         * @var string
@@ -107,7 +107,7 @@
                }
                $propUri = $topUri."prop/";
 
-               $this->namespaces = array (
+               $this->namespaces = array(
                                'rdf' => 
'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
                                'rdfs' => 
'http://www.w3.org/2000/01/rdf-schema#',
                                'xsd' => 'http://www.w3.org/2001/XMLSchema#',
diff --git a/repo/tests/phpunit/includes/Diff/ClaimDifferenceTest.php 
b/repo/tests/phpunit/includes/Diff/ClaimDifferenceTest.php
index 3b41f9b..fcd102f 100644
--- a/repo/tests/phpunit/includes/Diff/ClaimDifferenceTest.php
+++ b/repo/tests/phpunit/includes/Diff/ClaimDifferenceTest.php
@@ -80,7 +80,7 @@
        public function atomicClaimDifferenceProvider() {
                $claimDifferenceObjects = array();
                $changeOp = new DiffOpChange( "old", "new" );
-               $diff = new Diff( array ( $changeOp ) );
+               $diff = new Diff( array( $changeOp ) );
 
                $claimDifferenceObjects[] = new ClaimDifference( $changeOp );
                $claimDifferenceObjects[] = new ClaimDifference( null, $diff );
@@ -93,7 +93,7 @@
        public function nonAtomicClaimDifferenceProvider() {
                $claimDifferenceObjects = array();
                $changeOp = new DiffOpChange( "old", "new" );
-               $diff = new Diff( array ( $changeOp ) );
+               $diff = new Diff( array( $changeOp ) );
 
                $claimDifferenceObjects[] = new ClaimDifference();
                $claimDifferenceObjects[] = new ClaimDifference( $changeOp, 
$diff, null, null );
diff --git 
a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php 
b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
index da036ba..d524c95 100644
--- a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
+++ b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
@@ -154,7 +154,7 @@
                                'de' => array( 'language' => 'de', 'value' => 
'berlin' )
                        ) ),
                        array( 'labels' => array( 'en' => array( 'language' => 
'en', 'value' => 'bar' ) ) ),
-                       array( ),
+                       array(),
                        array(
                                'labels' => array(
                                'en' => array( 'language' => 'en', 'value' => 
'bar' ),
diff --git 
a/repo/tests/phpunit/includes/LinkedData/HttpAcceptNegotiatorTest.php 
b/repo/tests/phpunit/includes/LinkedData/HttpAcceptNegotiatorTest.php
index c5cc90b..37a36ae 100644
--- a/repo/tests/phpunit/includes/LinkedData/HttpAcceptNegotiatorTest.php
+++ b/repo/tests/phpunit/includes/LinkedData/HttpAcceptNegotiatorTest.php
@@ -18,8 +18,8 @@
        public function provideGetFirstSupportedValue() {
                return array(
                        array( // #0: empty
-                               array( ), // supported
-                               array( ), // accepted
+                               array(), // supported
+                               array(), // accepted
                                null, // default
                                null,  // expected
                        ),
@@ -75,8 +75,8 @@
        public function provideGetBestSupportedKey() {
                return array(
                        array( // #0: empty
-                               array( ), // supported
-                               array( ), // accepted
+                               array(), // supported
+                               array(), // accepted
                                null, // default
                                null,  // expected
                        ),
diff --git a/repo/tests/phpunit/includes/api/EditEntityTest.php 
b/repo/tests/phpunit/includes/api/EditEntityTest.php
index f6b4a8f..6267b78 100644
--- a/repo/tests/phpunit/includes/api/EditEntityTest.php
+++ b/repo/tests/phpunit/includes/api/EditEntityTest.php
@@ -244,14 +244,14 @@
                                                'rank' => 'normal' ) ) ) ),
 
                        'change the claim' => array(
-                               'p' => array( 'data' => array (
-                                       'claims' => array (
-                                                       array (
+                               'p' => array( 'data' => array(
+                                       'claims' => array(
+                                                       array(
                                                                'id' => 
'%lastClaimId%',
-                                                               'mainsnak' => 
array (
+                                                               'mainsnak' => 
array(
                                                                                
'snaktype' => 'value',
                                                                                
'property' => '%P56%',
-                                                                               
'datavalue' => array ( 'value' => 'diffstring', 'type' => 'string' ),
+                                                                               
'datavalue' => array( 'value' => 'diffstring', 'type' => 'string' ),
                                                                        ),
                                                                'type' => 
'statement',
                                                                'rank' => 
'normal',
diff --git a/repo/tests/phpunit/includes/api/GetEntitiesTest.php 
b/repo/tests/phpunit/includes/api/GetEntitiesTest.php
index 453a8a8..322a54c 100644
--- a/repo/tests/phpunit/includes/api/GetEntitiesTest.php
+++ b/repo/tests/phpunit/includes/api/GetEntitiesTest.php
@@ -412,7 +412,7 @@
                //todo more exception checks should be added once Bug:53038 is 
resolved
                return array(
                        array( //0 no params
-                               'p' => array( ),
+                               'p' => array(),
                                'e' => array( 'exception' => array( 'type' => 
'UsageException', 'code' => 'param-missing' ) ) ),
                        array( //1 bad id
                                'p' => array( 'ids' => 'ABCD' ),
diff --git a/repo/tests/phpunit/includes/api/ItemByTitleHelperTest.php 
b/repo/tests/phpunit/includes/api/ItemByTitleHelperTest.php
index 402e0e0..7144698 100644
--- a/repo/tests/phpunit/includes/api/ItemByTitleHelperTest.php
+++ b/repo/tests/phpunit/includes/api/ItemByTitleHelperTest.php
@@ -189,14 +189,14 @@
                return array(
                        array(
                                // Request with no sites
-                               array( ),
+                               array(),
                                array( 'barfoo' ),
                                false
                        ),
                        array(
                                // Request with no titles
                                array( 'enwiki' ),
-                               array( ),
+                               array(),
                                false
                        ),
                );
diff --git a/repo/tests/phpunit/includes/api/MergeItemsTest.php 
b/repo/tests/phpunit/includes/api/MergeItemsTest.php
index e9c1ae3..c187f6e 100644
--- a/repo/tests/phpunit/includes/api/MergeItemsTest.php
+++ b/repo/tests/phpunit/includes/api/MergeItemsTest.php
@@ -154,7 +154,7 @@
                                'type' => 'statement', 'rank' => 'normal', 'id' 
=> 'deadbeefdeadbeefdeadbeefdeadbeef' ) ) ) ),
                        array(),
                        array(),
-                       array( 'claims' => array( 'P1' => array ( array( 
'mainsnak' => array(
+                       array( 'claims' => array( 'P1' => array( array( 
'mainsnak' => array(
                                'snaktype' => 'value', 'property' => 'P1', 
'datavalue' => array( 'value' => 'imastring', 'type' => 'string' ) ),
                                'type' => 'statement', 'rank' => 'normal' ) ) ) 
),
                );
@@ -214,7 +214,7 @@
        public function provideExceptionParamsData() {
                return array(
                        array( //0 no ids given
-                               'p' => array( ),
+                               'p' => array(),
                                'e' => array( 'exception' => array( 'type' => 
'UsageException', 'code' => 'param-missing' ) ) ),
                        array( //1 only from id
                                'p' => array( 'fromid' => 'Q1' ),
diff --git a/repo/tests/phpunit/includes/api/ModifyTermTestCase.php 
b/repo/tests/phpunit/includes/api/ModifyTermTestCase.php
index 9701227..b605142 100644
--- a/repo/tests/phpunit/includes/api/ModifyTermTestCase.php
+++ b/repo/tests/phpunit/includes/api/ModifyTermTestCase.php
@@ -51,7 +51,7 @@
                                'e' => array( 'value' => array( 'bat-smg' => 
'V?sata' ) ) ),
                        array( //7
                                'p' => array( 'language' => 'bat-smg', 'value' 
=> '' ),
-                               'e' => array( ) ),
+                               'e' => array() ),
                        array( //8
                                'p' => array( 'language' => 'en', 'value' => "  
x\nx  " ),
                                'e' => array( 'value' => array( 'en' => 'x x' ) 
) ),
diff --git a/repo/tests/phpunit/includes/api/ResultBuilderTest.php 
b/repo/tests/phpunit/includes/api/ResultBuilderTest.php
index 322049c..1f50432 100644
--- a/repo/tests/phpunit/includes/api/ResultBuilderTest.php
+++ b/repo/tests/phpunit/includes/api/ResultBuilderTest.php
@@ -294,7 +294,7 @@
                                'zh_classicalwiki' => array(
                                        'site' => 'zh_classicalwiki',
                                        'title' => 'User:Addshore',
-                                       'badges' => array( )
+                                       'badges' => array()
                                ),
                        ),
                ) ) );
@@ -354,8 +354,7 @@
                                        'enwiki' => array(
                                                'site' => 'enwiki',
                                                'title' => 'Berlin',
-                                               'badges' => array(
-                                               )
+                                               'badges' => array()
                                        ),
                                ),
                        ),
diff --git a/repo/tests/phpunit/includes/api/SetAliasesTest.php 
b/repo/tests/phpunit/includes/api/SetAliasesTest.php
index 590333f..aa0c0db 100644
--- a/repo/tests/phpunit/includes/api/SetAliasesTest.php
+++ b/repo/tests/phpunit/includes/api/SetAliasesTest.php
@@ -75,7 +75,7 @@
                                'e' => array( 'value' => array( 'en' => array( 
'ohi' ) ) ) ),
                        array( //12
                                'p' => array( 'language' => 'en', 'remove' => 
'ohi' ),
-                               'e' => array(  ) ),
+                               'e' => array() ),
                        array( //13
                                'p' => array( 'language' => 'en', 'set' => "  
Foo\nBar  " ),
                                'e' => array( 'value' => array( 'en' => array( 
'Foo Bar' ) ) ) ),
diff --git a/repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php 
b/repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
index de241f7..54f9371 100644
--- a/repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
+++ b/repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
@@ -280,7 +280,7 @@
                                                    //       gregorian an 
output as an XSD date.
                                new PropertyId( 'P8' ),
                                new TimeValue( '+1492-10-12T00:00:00Z', 0, 0, 
0, TimeValue::PRECISION_DAY, RdfVocabulary::JULIAN_CALENDAR ),
-                               array (
+                               array(
                                        // Julian-to-Gregorian conversion 
applies.
                                        '<http://acme.test/Q11> 
<http://acme.test/prop/statement/P8> 
"1492-10-21T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .',
                                        '<http://acme.test/Q11> 
<http://acme.test/prop/statement/value/P8> 
<http://acme.test/value/23a636870974bab8f1771b34aa994936> .',
diff --git a/view/tests/phpunit/ClaimHtmlGeneratorTest.php 
b/view/tests/phpunit/ClaimHtmlGeneratorTest.php
index 4360712..10a6804 100644
--- a/view/tests/phpunit/ClaimHtmlGeneratorTest.php
+++ b/view/tests/phpunit/ClaimHtmlGeneratorTest.php
@@ -120,7 +120,7 @@
                        new Statement(
                                new PropertyValueSnak( 50, new StringValue( 
'chocolate!' ) ),
                                new SnakList(),
-                               new ReferenceList( array( new Reference( new 
SnakList( array (
+                               new ReferenceList( array( new Reference( new 
SnakList( array(
                                        new PropertyValueSnak( 50, new 
StringValue( 'second snak' ) )
                                ) ) ) ) )
                        ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I038a0f4830397f058fcdf4e7e5a4266c195351de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to