diff --git a/src/Response/Address.php b/src/Response/Address.php index 1510c25..09e2e87 100644 --- a/src/Response/Address.php +++ b/src/Response/Address.php @@ -1146,4 +1146,15 @@ public function getResult(): ?string { return $this->result; } + + /** + * @param non-empty-string $result + */ + public function withResult(string $result): self + { + $new = clone $this; + $new->result = $result; + + return $new; + } } diff --git a/src/Response/SuggestAddress.php b/src/Response/SuggestAddress.php index 0e956da..e30f886 100644 --- a/src/Response/SuggestAddress.php +++ b/src/Response/SuggestAddress.php @@ -34,7 +34,7 @@ final class SuggestAddress */ public function __construct(Address $data, string $value, string $unrestrictedValue) { - $this->data = $data; + $this->data = $data->withResult($value); $this->value = $value; $this->unrestrictedValue = $unrestrictedValue; }