Skip to content

Commit 0e6c98a

Browse files
StadlyNyholm
authored andcommitted
Use the returned query after setting bounds or locale (#815)
After choosing to use bounds or locale with a query, the returned query object must be used.
1 parent 6603358 commit 0e6c98a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

StatefulGeocoder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ public function geocode(string $value): Collection
6262
->withLimit($this->limit);
6363

6464
if (!empty($this->locale)) {
65-
$query->withLocale($this->locale);
65+
$query = $query->withLocale($this->locale);
6666
}
6767

6868
if (!empty($this->bounds)) {
69-
$query->withBounds($this->bounds);
69+
$query = $query->withBounds($this->bounds);
7070
}
7171

7272
return $this->provider->geocodeQuery($query);
@@ -112,7 +112,7 @@ public function reverseQuery(ReverseQuery $query): Collection
112112
{
113113
$locale = $query->getLocale();
114114
if (empty($locale) && null !== $this->locale) {
115-
$query->withLocale($this->locale);
115+
$query = $query->withLocale($this->locale);
116116
}
117117

118118
return $this->provider->reverseQuery($query);

0 commit comments

Comments
 (0)