Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 12b3dd3

Browse files
authored
Merge pull request #743 from Nyholm/query-with
Add withText and withCoordinates.
2 parents c6d6f94 + 2f385d2 commit 12b3dd3

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/Common/Query/GeocodeQuery.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,19 @@ public static function create(string $text): GeocodeQuery
7070
return new self($text);
7171
}
7272

73+
/**
74+
* @param string $text
75+
*
76+
* @return GeocodeQuery
77+
*/
78+
public function withTest(string $text): GeocodeQuery
79+
{
80+
$new = clone $this;
81+
$new->text = $text;
82+
83+
return $new;
84+
}
85+
7386
/**
7487
* @param Bounds $bounds
7588
*

src/Common/Query/ReverseQuery.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@ public static function fromCoordinates($latitude, $longitude): ReverseQuery
6969
return new self(new Coordinates($latitude, $longitude));
7070
}
7171

72+
/**
73+
* @param Coordinates $coordinates
74+
*
75+
* @return ReverseQuery
76+
*/
77+
public function withCoordinates(Coordinates $coordinates): ReverseQuery
78+
{
79+
$new = clone $this;
80+
$new->coordinates = $coordinates;
81+
82+
return $new;
83+
}
84+
7285
/**
7386
* @param int $limit
7487
*

0 commit comments

Comments
 (0)