jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/352358 )

Change subject: Fix multiple rare PHPCS violations
......................................................................


Fix multiple rare PHPCS violations

Change-Id: I98c2f6ca9747b94d6e2872c4d88a1835eb621675
---
M includes/CrossCheck/CrossChecker.php
M includes/DumpMetaInformation/DumpMetaInformation.php
M maintenance/UpdateExternalData.php
M phpcs.xml
M specials/SpecialExternalDatabases.php
M tests/phpunit/CrossCheck/Comparer/EntityIdValueComparerTest.php
M tests/phpunit/CrossCheck/Comparer/MultilingualTextValueComparerTest.php
M tests/phpunit/CrossCheck/ValueParser/ComparativeValueParserFactoryTest.php
8 files changed, 30 insertions(+), 36 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  Lucas Werkmeister (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/CrossCheck/CrossChecker.php 
b/includes/CrossCheck/CrossChecker.php
index 5a9f868..b40b6fa 100644
--- a/includes/CrossCheck/CrossChecker.php
+++ b/includes/CrossCheck/CrossChecker.php
@@ -285,8 +285,7 @@
                                $result = ComparisonResult::STATUS_MISMATCH;
                                if( in_array( ComparisonResult::STATUS_MATCH, 
$results ) ) {
                                        $result = 
ComparisonResult::STATUS_MATCH;
-                               }
-                               elseif( in_array( 
ComparisonResult::STATUS_PARTIAL_MATCH, $results ) ) {
+                               } elseif ( in_array( 
ComparisonResult::STATUS_PARTIAL_MATCH, $results ) ) {
                                        $result = 
ComparisonResult::STATUS_PARTIAL_MATCH;
                                }
 
@@ -316,8 +315,8 @@
                                if( $parsedValue ) {
                                        $parsedValues[] = $parsedValue;
                                }
+                       } catch ( ParseException $e ) {
                        }
-                       catch( ParseException $e ) {}
                }
 
                return $parsedValues;
@@ -372,7 +371,7 @@
         * @param StatementList $statementList
         * @return DataValue[]
         */
-       private function getDataValues( StatementList $statementList ){
+       private function getDataValues( StatementList $statementList ) {
                $dataValues = array();
 
                foreach ( $statementList->toArray() as $statement ) {
diff --git a/includes/DumpMetaInformation/DumpMetaInformation.php 
b/includes/DumpMetaInformation/DumpMetaInformation.php
index 4429acb..fd06702 100644
--- a/includes/DumpMetaInformation/DumpMetaInformation.php
+++ b/includes/DumpMetaInformation/DumpMetaInformation.php
@@ -230,7 +230,7 @@
         *
         * @throws InvalidArgumentException
         */
-       private function setSize( $size ){
+       private function setSize( $size ) {
                Assert::parameterType( 'integer', $size, '$size' );
                if( $size <= 0 ) {
                        throw new InvalidArgumentException( '$size must be 
positive integer.' );
diff --git a/maintenance/UpdateExternalData.php 
b/maintenance/UpdateExternalData.php
index eaa6ee4..8e89c97 100644
--- a/maintenance/UpdateExternalData.php
+++ b/maintenance/UpdateExternalData.php
@@ -45,6 +45,7 @@
                );
                $importer->import();
        }
+
 }
 
 // @codeCoverageIgnoreStart
diff --git a/phpcs.xml b/phpcs.xml
index ce061c4..16d5de9 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -3,18 +3,12 @@
        <rule ref="vendor/wikibase/wikibase-codesniffer/Wikibase">
                <!-- FIXME: The following should all be fixed. -->
                <exclude name="Generic.Arrays.DisallowLongArraySyntax" />
-               <exclude 
name="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
-               <exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
                <exclude 
name="MediaWiki.ControlStructures.AssignmentInControlStructures" />
-               <exclude name="MediaWiki.ControlStructures.IfElseStructure" />
                <exclude name="MediaWiki.WhiteSpace.SpaceAfterControlStructure" 
/>
                <exclude name="MediaWiki.WhiteSpace.SpaceyParenthesis" />
                <exclude name="PSR1.Classes.ClassDeclaration" />
                <exclude name="PSR2.Methods.MethodDeclaration" />
                <exclude name="Squiz.ControlStructures.ControlSignature" />
-               <exclude name="Squiz.Scope.MethodScope" />
-               <exclude name="Squiz.WhiteSpace.FunctionSpacing" />
-               <exclude name="Squiz.WhiteSpace.ScopeClosingBrace" />
        </rule>
 
        <!-- Exceptions -->
diff --git a/specials/SpecialExternalDatabases.php 
b/specials/SpecialExternalDatabases.php
index b467154..257f486 100644
--- a/specials/SpecialExternalDatabases.php
+++ b/specials/SpecialExternalDatabases.php
@@ -67,7 +67,7 @@
         *
         * @return string
         */
-       function getGroupName() {
+       protected function getGroupName() {
                return 'wikibasequality';
        }
 
diff --git a/tests/phpunit/CrossCheck/Comparer/EntityIdValueComparerTest.php 
b/tests/phpunit/CrossCheck/Comparer/EntityIdValueComparerTest.php
index 50f9b09..64dea07 100644
--- a/tests/phpunit/CrossCheck/Comparer/EntityIdValueComparerTest.php
+++ b/tests/phpunit/CrossCheck/Comparer/EntityIdValueComparerTest.php
@@ -147,24 +147,24 @@
                                        }
 
                                        return $terms;
-                       }
-               ) );
+                               }
+                       ) );
 
                $stringComparer = $this->getMockBuilder( StringComparer::class )
                        ->disableOriginalConstructor()
                        ->setMethods( array( 'compareWithArray' ) )
                        ->getMock();
                $stringComparer->expects( $this->any() )
-                                               ->method( 'compareWithArray' )
-                                               ->will( $this->returnCallback(
-                                                       function ( $value, 
array $values ) {
-                                                               if ( in_array(  
$value, $values ) ) {
-                                                                       return 
ComparisonResult::STATUS_MATCH;
-                                                               } else {
-                                                                       return 
ComparisonResult::STATUS_MISMATCH;
-                                                          }
-                                                       }
-                                               ) );
+                       ->method( 'compareWithArray' )
+                       ->will( $this->returnCallback(
+                               function ( $value, array $values ) {
+                                       if ( in_array(  $value, $values ) ) {
+                                               return 
ComparisonResult::STATUS_MATCH;
+                                       } else {
+                                               return 
ComparisonResult::STATUS_MISMATCH;
+                                       }
+                               }
+                       ) );
 
                return new EntityIdValueComparer( $termIndex, $stringComparer );
        }
diff --git 
a/tests/phpunit/CrossCheck/Comparer/MultilingualTextValueComparerTest.php 
b/tests/phpunit/CrossCheck/Comparer/MultilingualTextValueComparerTest.php
index cf9dc92..3c58656 100644
--- a/tests/phpunit/CrossCheck/Comparer/MultilingualTextValueComparerTest.php
+++ b/tests/phpunit/CrossCheck/Comparer/MultilingualTextValueComparerTest.php
@@ -135,16 +135,16 @@
                        ->setMethods( array ( 'compare' ) )
                        ->getMock();
                $stringComparer->expects( $this->any() )
-                                               ->method( 'compare' )
-                                               ->will( $this->returnCallback(
-                                                               function ( 
$value1, $value2 ) {
-                                                                               
if ( $value1 === $value2 ) {
-                                                                               
        return ComparisonResult::STATUS_MATCH;
-                                                                               
} else {
-                                                                               
        return ComparisonResult::STATUS_MISMATCH;
-                                                                               
}
-                                                                       }
-                                                               ) );
+                       ->method( 'compare' )
+                       ->will( $this->returnCallback(
+                               function ( $value1, $value2 ) {
+                                       if ( $value1 === $value2 ) {
+                                               return 
ComparisonResult::STATUS_MATCH;
+                                       } else {
+                                               return 
ComparisonResult::STATUS_MISMATCH;
+                                       }
+                               }
+                       ) );
 
                return new MultilingualTextValueComparer( $stringComparer );
        }
diff --git 
a/tests/phpunit/CrossCheck/ValueParser/ComparativeValueParserFactoryTest.php 
b/tests/phpunit/CrossCheck/ValueParser/ComparativeValueParserFactoryTest.php
index d4f09fb..d6aaebd 100644
--- a/tests/phpunit/CrossCheck/ValueParser/ComparativeValueParserFactoryTest.php
+++ b/tests/phpunit/CrossCheck/ValueParser/ComparativeValueParserFactoryTest.php
@@ -47,8 +47,8 @@
                        ),
                        'VT:monolingualtext' => array(
                                'parser-factory-callback' => function( 
ParserOptions $options ) {
-                   return new MonolingualTextParser( $options );
-               }
+                                       return new MonolingualTextParser( 
$options );
+                               }
                        )
                );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I98c2f6ca9747b94d6e2872c4d88a1835eb621675
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <lucas.werkmeis...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to