]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove unused variables
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 9 Jul 2021 14:36:42 +0000 (16:36 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 9 Jul 2021 14:36:42 +0000 (16:36 +0200)
As reported by sonarqube.

lib-php/AddressDetails.php
lib-php/DebugHtml.php
lib-php/Geocode.php
lib-php/ReverseGeocode.php
lib-php/SearchDescription.php
lib-php/tokenizer/legacy_tokenizer.php

index bf8defc230a9c66b0a1f52ec2049e7522a7b7491..fc7fbec7a66f748f4610d504df08615500531a98 100644 (file)
@@ -61,7 +61,7 @@ class AddressDetails
         return join(', ', $aParts);
     }
 
-    public function getAddressNames($sCountry = null)
+    public function getAddressNames()
     {
         $aAddress = array();
 
index 98da8794055c644e23fbb90ffdbbc6d3d5b45f8e..19221b435b2f14cdaca2459eabe8ea483f804f8e 100644 (file)
@@ -78,7 +78,7 @@ class Debug
         echo '<th>Address Tokens</th><th>Address Not</th>';
         echo '<th>country</th><th>operator</th>';
         echo '<th>class</th><th>type</th><th>postcode</th><th>housenumber</th></tr>';
-        foreach ($aSearches as $iRank => $aRankedSet) {
+        foreach ($aSearches as $aRankedSet) {
             foreach ($aRankedSet as $aRow) {
                 $aRow->dumpAsHtmlTableRow($aWordsIDs);
             }
index a3883b2509fdc3477881f1f06b87ff9dfb9509bd..ccb8a81032362c5a7dfc4e5c825442fd34288f32 100644 (file)
@@ -417,7 +417,7 @@ class Geocode
 
             $iSearchCount = 0;
             $aSearches = array();
-            foreach ($aGroupedSearches as $iScore => $aNewSearches) {
+            foreach ($aGroupedSearches as $aNewSearches) {
                 $iSearchCount += count($aNewSearches);
                 $aSearches = array_merge($aSearches, $aNewSearches);
                 if ($iSearchCount > 50) break;
@@ -503,10 +503,6 @@ class Geocode
 
         Debug::newSection('Query Preprocessing');
 
-        $sLanguagePrefArraySQL = $this->oDB->getArraySQL(
-            $this->oDB->getDBQuotedList($this->aLangPrefOrder)
-        );
-
         $sQuery = $this->sQuery;
         if (!preg_match('//u', $sQuery)) {
             userError('Query string is not UTF-8 encoded.');
@@ -891,15 +887,8 @@ class Geocode
         $aToFilter = $aSearchResults;
         $aSearchResults = array();
 
-        $bFirst = true;
         foreach ($aToFilter as $aResult) {
             $this->aExcludePlaceIDs[$aResult['place_id']] = $aResult['place_id'];
-            if ($bFirst) {
-                $fLat = $aResult['lat'];
-                $fLon = $aResult['lon'];
-                if (isset($aResult['zoom'])) $iZoom = $aResult['zoom'];
-                $bFirst = false;
-            }
             if (!$this->oPlaceLookup->doDeDupe() || (!isset($aOSMIDDone[$aResult['osm_type'].$aResult['osm_id']])
                 && !isset($aClassTypeNameDone[$aResult['osm_type'].$aResult['class'].$aResult['type'].$aResult['name'].$aResult['admin_level']]))
             ) {
index cf396b7ab8fa0352f8554111dac87dd942950f52..0a3841f237291a75e7585444622a0ce3787d35aa 100644 (file)
@@ -74,8 +74,6 @@ class ReverseGeocode
 
     protected function lookupLargeArea($sPointSQL, $iMaxRank)
     {
-        $oResult = null;
-
         if ($iMaxRank > 4) {
             $aPlace = $this->lookupPolygon($sPointSQL, $iMaxRank);
             if ($aPlace) {
@@ -190,7 +188,6 @@ class ReverseGeocode
 
         if ($aPoly) {
         // if a polygon is found, search for placenodes begins ...
-            $iParentPlaceID = $aPoly['parent_place_id'];
             $iRankAddress = $aPoly['rank_address'];
             $iRankSearch = $aPoly['rank_search'];
             $iPlaceID = $aPoly['place_id'];
@@ -356,7 +353,6 @@ class ReverseGeocode
                     $oResult = new Result($aHouse['place_id'], Result::TABLE_OSMLINE);
                     $oResult->iHouseNumber = closestHouseNumber($aHouse);
                     $aPlace = $aHouse;
-                    $iRankAddress = 30;
                 }
             }
 
index 3c572f2fc872e1e41a47580b80d156834870b964..6091fd617396b38cf55bd242fcf95d70de67c5c3 100644 (file)
@@ -415,7 +415,6 @@ class SearchDescription
     public function query(&$oDB, $iMinRank, $iMaxRank, $iLimit)
     {
         $aResults = array();
-        $iHousenumber = -1;
 
         if ($this->sCountryCode
             && empty($this->aName)
index 0fb37fd09ba7a34ffec578e00529121fd754c7c8..50207c31785d6c3579418fa42931f8d6a39be81c 100644 (file)
@@ -105,7 +105,7 @@ class Tokenizer
         // now compute all possible tokens
         $aWordLists = array();
         $aTokens = array();
-        foreach ($aNormPhrases as $sTitle => $sPhrase) {
+        foreach ($aNormPhrases as $sPhrase) {
             if (strlen($sPhrase) > 0) {
                 $aWords = explode(' ', $sPhrase);
                 Tokenizer::addTokens($aTokens, $aWords);