File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ final class MapboxAddress extends Address
5656 */
5757 private $ matchConfidence ;
5858
59+ /**
60+ * @var string|null
61+ */
62+ private $ accuracy ;
63+
5964 public function withId (?string $ id = null ): self
6065 {
6166 $ new = clone $ this ;
@@ -174,4 +179,17 @@ public function withMatchConfidence(?string $matchConfidence = null): self
174179
175180 return $ new ;
176181 }
182+
183+ public function getAccuracy (): ?string
184+ {
185+ return $ this ->accuracy ;
186+ }
187+
188+ public function withAccuracy (?string $ accuracy = null ): self
189+ {
190+ $ new = clone $ this ;
191+ $ new ->accuracy = $ accuracy ;
192+
193+ return $ new ;
194+ }
177195}
Original file line number Diff line number Diff line change @@ -42,4 +42,16 @@ public function testMatchConfidence(): void
4242 $ this ->assertSame ('exact ' , $ address ->getMatchConfidence ());
4343 $ this ->assertNull ($ address ->withMatchConfidence ('exact ' )->withMatchConfidence ()->getMatchConfidence ());
4444 }
45+
46+ public function testAccuracy (): void
47+ {
48+ $ address = (new AddressBuilder ('mapbox ' ))->build (MapboxAddress::class);
49+
50+ $ this ->assertNull ($ address ->getAccuracy ());
51+
52+ $ address = $ address ->withAccuracy ('rooftop ' );
53+
54+ $ this ->assertSame ('rooftop ' , $ address ->getAccuracy ());
55+ $ this ->assertNull ($ address ->withAccuracy ('rooftop ' )->withAccuracy ()->getAccuracy ());
56+ }
4557}
You can’t perform that action at this time.
0 commit comments