Skip to content

Commit

Permalink
Updated geocode query to allow support for qualified queries
Browse files Browse the repository at this point in the history
  • Loading branch information
SCatrinh committed Jun 25, 2024
1 parent 608c9c0 commit 72a671d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Common/Query/GeocodeQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class GeocodeQuery implements Query
/**
* The address or text that should be geocoded.
*
* @var string
* @var string | null
*/
private $text;

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

private function __construct(string $text)
private function __construct(?string $text)
{
if ('' === $text) {
throw new InvalidArgument('Geocode query cannot be empty');
}

$this->text = $text;
}

public static function create(string $text): self
public static function create(?string $text): self
{
return new self($text);
}
Expand Down Expand Up @@ -102,7 +98,7 @@ public function withData(string $name, mixed $value): self
return $new;
}

public function getText(): string
public function getText(): ?string
{
return $this->text;
}
Expand Down

0 comments on commit 72a671d

Please sign in to comment.