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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
......................................................................


build: Updating mediawiki/mediawiki-codesniffer to 0.9.0

The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.FunctionComment.Missing.Protected
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I50914add9df15734ce06902841768ce8c8d266d0
---
M .gitignore
M composer.json
M includes/CoordinatesParserFunction.php
M includes/Globe.php
M includes/Search/CirrusGeoFeature.php
M includes/Search/GeoPointIndexField.php
M includes/api/ApiQueryCoordinates.php
M includes/api/ApiQueryGeoSearchDb.php
M includes/api/ApiQueryGeoSearchElastic.php
M maintenance/updateIndexGranularity.php
M phpcs.xml
M tests/phpunit/GeoFeatureTest.php
12 files changed, 28 insertions(+), 20 deletions(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.gitignore b/.gitignore
index 104d3b8..5abae2c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
 node_modules/
 tests/phan/issues
 /vendor
+composer.lock
diff --git a/composer.json b/composer.json
index b8f68fb..4a8c744 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9.2",
                "jakub-onderka/php-console-highlighter": "0.3.2",
-               "mediawiki/mediawiki-codesniffer": "0.7.2"
+               "mediawiki/mediawiki-codesniffer": "0.9.0"
        },
        "scripts": {
                "fix": "phpcbf",
diff --git a/includes/CoordinatesParserFunction.php 
b/includes/CoordinatesParserFunction.php
index 4257761..07a9ff4 100644
--- a/includes/CoordinatesParserFunction.php
+++ b/includes/CoordinatesParserFunction.php
@@ -155,7 +155,6 @@
                        : $wgDefaultGlobe;
 
                $this->globe = new Globe( $globe );
-
        }
 
        private function applyTagArgs( Coord $coord ) {
diff --git a/includes/Globe.php b/includes/Globe.php
index d44901d..d1271d1 100644
--- a/includes/Globe.php
+++ b/includes/Globe.php
@@ -58,12 +58,14 @@
                $east360 = [ 'lon' => [ 0, 360 ],    'east' => +1 ];
                $west360 = [ 'lon' => [ 0, 360 ],    'east' => -1 ];
 
-               // Format:
-               //   'lon' => array of [minimum value, maximum value]
-               //   'east' => sign 1 degree East would have
-               //   'radius' => mean radius in meters (optional)
-               // Coordinate systems mostly taken from 
http://planetarynames.wr.usgs.gov/TargetCoordinates
-               // Radii taken from Wikipedia. Globes that are too irregular in 
shape don't have radius set.
+               /**
+                * Format:
+                * 'lon' => array of [minimum value, maximum value]
+                * 'east' => sign 1 degree East would have
+                * 'radius' => mean radius in meters (optional)
+                * Coordinate systems mostly taken from 
http://planetarynames.wr.usgs.gov/TargetCoordinates
+                * Radii taken from Wikipedia. Globes that are too irregular in 
shape don't have radius set.
+                */
                $data = [
                        'earth'     => $earth   + [ 'radius' => 
Math::EARTH_RADIUS ],
                        'mercury'   => $west360 + [ 'radius' => 2439700.0 ],
diff --git a/includes/Search/CirrusGeoFeature.php 
b/includes/Search/CirrusGeoFeature.php
index 812fcd8..5b24755 100644
--- a/includes/Search/CirrusGeoFeature.php
+++ b/includes/Search/CirrusGeoFeature.php
@@ -219,7 +219,7 @@
                        'yd' => 0.9144,
                ];
 
-               return max( 10, (int) round( $matches[1] * $scale[$matches[2]] 
) );
+               return max( 10, (int)round( $matches[1] * $scale[$matches[2]] ) 
);
        }
 
        /**
diff --git a/includes/Search/GeoPointIndexField.php 
b/includes/Search/GeoPointIndexField.php
index 261f487..267ccbe 100644
--- a/includes/Search/GeoPointIndexField.php
+++ b/includes/Search/GeoPointIndexField.php
@@ -22,4 +22,3 @@
                parent::__construct( $name, $this->typeName, $config );
        }
 }
-
diff --git a/includes/api/ApiQueryCoordinates.php 
b/includes/api/ApiQueryCoordinates.php
index 794da05..55c5927 100644
--- a/includes/api/ApiQueryCoordinates.php
+++ b/includes/api/ApiQueryCoordinates.php
@@ -68,7 +68,7 @@
                                'lat' => floatval( $row->gt_lat ),
                                'lon' => floatval( $row->gt_lon ),
                        ];
-                       if ( $row->gt_primary ) {
+                       if ( $row->gt_primary ) {
                                $vals['primary'] = '';
                        }
                        foreach ( $params['prop'] as $prop ) {
diff --git a/includes/api/ApiQueryGeoSearchDb.php 
b/includes/api/ApiQueryGeoSearchDb.php
index ea47afd..1eb3434 100644
--- a/includes/api/ApiQueryGeoSearchDb.php
+++ b/includes/api/ApiQueryGeoSearchDb.php
@@ -50,7 +50,7 @@
                        $rows[] = $row;
                }
                // sort in PHP because sorting via SQL would involve a filesort
-               usort( $rows, function( $row1, $row2 ) {
+               usort( $rows, function ( $row1, $row2 ) {
                        if ( $row1->dist == $row2->dist ) {
                                return 0;
                        }
diff --git a/includes/api/ApiQueryGeoSearchElastic.php 
b/includes/api/ApiQueryGeoSearchElastic.php
index 5e70640..48f7a5e 100644
--- a/includes/api/ApiQueryGeoSearchElastic.php
+++ b/includes/api/ApiQueryGeoSearchElastic.php
@@ -237,8 +237,8 @@
                }
                $primary = $this->params['primary'];
                if ( ( $primary == 'primary' && !$coord->primary )
-                       || ( $primary == 'secondary' && $coord->primary ) )
-               {
+                       || ( $primary == 'secondary' && $coord->primary )
+               ) {
                        return false;
                }
                return true;
diff --git a/maintenance/updateIndexGranularity.php 
b/maintenance/updateIndexGranularity.php
index b16944f..f597f68 100644
--- a/maintenance/updateIndexGranularity.php
+++ b/maintenance/updateIndexGranularity.php
@@ -55,4 +55,3 @@
 
 $maintClass = 'UpdateIndexGranularity';
 require_once DO_MAINTENANCE;
-
diff --git a/phpcs.xml b/phpcs.xml
index bf8461f..64d88ff 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,14 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0"?>
 <ruleset>
-       <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
+       <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
+               <exclude name="MediaWiki.FunctionComment.Missing.Protected" />
+               <exclude name="MediaWiki.FunctionComment.Missing.Public" />
+               <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
+       </rule>
        <rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
                <properties>
                        <property name="ignoreList" type="array" value="myrand" 
/>
                </properties>
        </rule>
        <file>.</file>
-       <arg name="extensions" value="php,php5,inc"/>
-       <arg name="encoding" value="UTF-8"/>
+       <arg name="extensions" value="php,php5,inc" />
+       <arg name="encoding" value="UTF-8" />
        <exclude-pattern>vendor</exclude-pattern>
        <exclude-pattern>node_modules</exclude-pattern>
        <exclude-pattern>tests/phan</exclude-pattern>
diff --git a/tests/phpunit/GeoFeatureTest.php b/tests/phpunit/GeoFeatureTest.php
index 30cc938..69822cc 100644
--- a/tests/phpunit/GeoFeatureTest.php
+++ b/tests/phpunit/GeoFeatureTest.php
@@ -253,7 +253,7 @@
                        ->method( 'select' )
                        ->with( 'geo_tags', $this->anything(), 
$this->anything(), $this->anything() )
                        ->will( $this->returnValue( [
-                               (object) [ 'gt_lat' => 1.2345, 'gt_lon' => 
5.4321 ],
+                               (object)[ 'gt_lat' => 1.2345, 'gt_lon' => 
5.4321 ],
                        ] ) );
                // Tell LinkCache all titles not explicitly added don't exist
                $db->expects( $this->any() )

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I50914add9df15734ce06902841768ce8c8d266d0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to