@@ -24,6 +24,16 @@ class Phone implements \JsonSerializable
2424 */
2525 public readonly ?bool $ isVoip ;
2626
27+ /**
28+ * @var bool|null This is `true` if the phone number's prefix is commonly
29+ * associated with the postal code. It is `false` if the
30+ * prefix is not associated with the postal code. It
31+ * is non-`null` only when the phone number is in the US,
32+ * the number prefix is in our database, and the postal
33+ * code and country are provided in the request.
34+ */
35+ public readonly ?bool $ matchesPostal ;
36+
2737 /**
2838 * @var string|null The name of the original network operator associated with
2939 * the phone number. This property does not reflect phone numbers
@@ -45,6 +55,7 @@ public function __construct(?array $response)
4555 {
4656 $ this ->country = $ response ['country ' ] ?? null ;
4757 $ this ->isVoip = $ response ['is_voip ' ] ?? null ;
58+ $ this ->matchesPostal = $ response ['matches_postal ' ] ?? null ;
4859 $ this ->networkOperator = $ response ['network_operator ' ] ?? null ;
4960 $ this ->numberType = $ response ['number_type ' ] ?? null ;
5061 }
@@ -64,6 +75,10 @@ public function jsonSerialize(): array
6475 $ js ['is_voip ' ] = $ this ->isVoip ;
6576 }
6677
78+ if ($ this ->matchesPostal !== null ) {
79+ $ js ['matches_postal ' ] = $ this ->matchesPostal ;
80+ }
81+
6782 if ($ this ->networkOperator !== null ) {
6883 $ js ['network_operator ' ] = $ this ->networkOperator ;
6984 }
0 commit comments