From cca912af4e57481707242ad05edaaa70c66dae96 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 18 Jul 2021 20:20:22 +0200 Subject: [PATCH] make all Token menbers private --- lib-php/Geocode.php | 12 ++++++------ lib-php/TokenSpecialTerm.php | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib-php/Geocode.php b/lib-php/Geocode.php index 82892eae..52b92c99 100644 --- a/lib-php/Geocode.php +++ b/lib-php/Geocode.php @@ -555,15 +555,15 @@ class Geocode if (!empty($aTokens)) { $aNewSearches = array(); + $oPosition = new SearchPosition('', 0, 1); + $oPosition->setTokenPosition(0, 1); + foreach ($aSearches as $oSearch) { foreach ($aTokens as $oToken) { - $oNewSearch = clone $oSearch; - $oNewSearch->setPoiSearch( - $oToken->iOperator, - $oToken->sClass, - $oToken->sType + $aNewSearches = array_merge( + $aNewSearches, + $oToken->extendSearch($oSearch, $oPosition) ); - $aNewSearches[] = $oNewSearch; } } $aSearches = $aNewSearches; diff --git a/lib-php/TokenSpecialTerm.php b/lib-php/TokenSpecialTerm.php index 355dbb91..5b2d4c70 100644 --- a/lib-php/TokenSpecialTerm.php +++ b/lib-php/TokenSpecialTerm.php @@ -10,13 +10,13 @@ require_once(CONST_LibDir.'/SpecialSearchOperator.php'); class SpecialTerm { /// Database word id, if applicable. - public $iId; + private $iId; /// Class (or OSM tag key) of the place to look for. - public $sClass; + private $sClass; /// Type (or OSM tag value) of the place to look for. - public $sType; + private $sType; /// Relationship of the operator to the object (see Operator class). - public $iOperator; + private $iOperator; public function __construct($iID, $sClass, $sType, $iOperator) { -- 2.43.2