Skip to content

Commit 72a671d

Browse files
committed
Updated geocode query to allow support for qualified queries
1 parent 608c9c0 commit 72a671d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Common/Query/GeocodeQuery.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class GeocodeQuery implements Query
2424
/**
2525
* The address or text that should be geocoded.
2626
*
27-
* @var string
27+
* @var string | null
2828
*/
2929
private $text;
3030

@@ -48,16 +48,12 @@ final class GeocodeQuery implements Query
4848
*/
4949
private $data = [];
5050

51-
private function __construct(string $text)
51+
private function __construct(?string $text)
5252
{
53-
if ('' === $text) {
54-
throw new InvalidArgument('Geocode query cannot be empty');
55-
}
56-
5753
$this->text = $text;
5854
}
5955

60-
public static function create(string $text): self
56+
public static function create(?string $text): self
6157
{
6258
return new self($text);
6359
}
@@ -102,7 +98,7 @@ public function withData(string $name, mixed $value): self
10298
return $new;
10399
}
104100

105-
public function getText(): string
101+
public function getText(): ?string
106102
{
107103
return $this->text;
108104
}

0 commit comments

Comments
 (0)