File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ final class MapboxAddress extends Address
5151 */
5252 private $ matchCode ;
5353
54+ /**
55+ * @var string|null
56+ */
57+ private $ matchConfidence ;
58+
5459 public function withId (?string $ id = null ): self
5560 {
5661 $ new = clone $ this ;
@@ -156,4 +161,17 @@ public function withMatchCode(?array $matchCode = null): self
156161
157162 return $ new ;
158163 }
164+
165+ public function getMatchConfidence (): ?string
166+ {
167+ return $ this ->matchConfidence ;
168+ }
169+
170+ public function withMatchConfidence (?string $ matchConfidence = null ): self
171+ {
172+ $ new = clone $ this ;
173+ $ new ->matchConfidence = $ matchConfidence ;
174+
175+ return $ new ;
176+ }
159177}
Original file line number Diff line number Diff line change @@ -30,4 +30,16 @@ public function testMatchCode(): void
3030 $ this ->assertSame ($ matchCode , $ address ->getMatchCode ());
3131 $ this ->assertNull ($ address ->withMatchCode ($ matchCode )->withMatchCode ()->getMatchCode ());
3232 }
33+
34+ public function testMatchConfidence (): void
35+ {
36+ $ address = (new AddressBuilder ('mapbox ' ))->build (MapboxAddress::class);
37+
38+ $ this ->assertNull ($ address ->getMatchConfidence ());
39+
40+ $ address = $ address ->withMatchConfidence ('exact ' );
41+
42+ $ this ->assertSame ('exact ' , $ address ->getMatchConfidence ());
43+ $ this ->assertNull ($ address ->withMatchConfidence ('exact ' )->withMatchConfidence ()->getMatchConfidence ());
44+ }
3345}
You can’t perform that action at this time.
0 commit comments