File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,13 @@ CHANGELOG
4
4
2.12.0
5
5
-------------------
6
6
7
+ * Support for mobile country code (MCC) and mobile network codes (MNC) was
8
+  added for the GeoIP2 ISP and Enterprise databases as well as the GeoIP2
9
+  City and Insights web services. ` $mobileCountryCode ` and
10
+  ` $mobileNetworkCode ` properties were added to ` GeoIp2\Model\Isp `
11
+  for the GeoIP2 ISP database and ` GeoIp2\Record\Traits ` for the Enterprise
12
+ database and the GeoIP2 City and Insights web services. We expect this data
13
+ to be available by late January, 2022.
7
14
* ` geoip2.phar ` is now generated with Box 3.x.
8
15
9
16
2.11.0 (2020-10-01)
Original file line number Diff line number Diff line change 16
16
* address.
17
17
* @property-read string|null $isp The name of the ISP associated with the IP
18
18
* address.
19
+ * @property-read string|null $mobileCountryCode The [mobile country code
20
+ * (MCC)](https://en.wikipedia.org/wiki/Mobile_country_code) associated with
21
+ * the IP address and ISP.
22
+ * @property-read string|null $mobileNetworkCode The [mobile network code
23
+ * (MNC)](https://en.wikipedia.org/wiki/Mobile_country_code) associated with
24
+ * the IP address and ISP.
19
25
* @property-read string|null $organization The name of the organization associated
20
26
* with the IP address.
21
27
* @property-read string $ipAddress The IP address that the data in the model is
@@ -38,6 +44,14 @@ class Isp extends AbstractModel
38
44
* @var string|null
39
45
*/
40
46
protected $ isp ;
47
+ /**
48
+ * @var string|null
49
+ */
50
+ protected $ mobileCountryCode ;
51
+ /**
52
+ * @var string|null
53
+ */
54
+ protected $ mobileNetworkCode ;
41
55
/**
42
56
* @var string|null
43
57
*/
@@ -61,6 +75,8 @@ public function __construct(array $raw)
61
75
$ this ->autonomousSystemOrganization =
62
76
$ this ->get ('autonomous_system_organization ' );
63
77
$ this ->isp = $ this ->get ('isp ' );
78
+ $ this ->mobileCountryCode = $ this ->get ('mobile_country_code ' );
79
+ $ this ->mobileNetworkCode = $ this ->get ('mobile_network_code ' );
64
80
$ this ->organization = $ this ->get ('organization ' );
65
81
66
82
$ ipAddress = $ this ->get ('ip_address ' );
Original file line number Diff line number Diff line change 76
76
* @property-read string|null $organization The name of the organization associated
77
77
* with the IP address. This attribute is only available from the City and
78
78
* Insights web services and the GeoIP2 Enterprise database.
79
+ * @property-read string|null $mobileCountryCode The [mobile country code
80
+ * (MCC)](https://en.wikipedia.org/wiki/Mobile_country_code) associated with
81
+ * the IP address and ISP. This property is available from the City and
82
+ * Insights web services and the GeoIP2 Enterprise database.
83
+ * @property-read string|null $mobileNetworkCode The [mobile network code
84
+ * (MNC)](https://en.wikipedia.org/wiki/Mobile_country_code) associated with
85
+ * the IP address and ISP. This property is available from the City and
86
+ * Insights web services and the GeoIP2 Enterprise database.
79
87
* @property-read float|null $staticIpScore An indicator of how static or
80
88
* dynamic an IP address is. This property is only available from GeoIP2
81
89
* Precision Insights.
@@ -130,6 +138,8 @@ class Traits extends AbstractRecord
130
138
'isResidentialProxy ' ,
131
139
'isSatelliteProvider ' ,
132
140
'isTorExitNode ' ,
141
+ 'mobileCountryCode ' ,
142
+ 'mobileNetworkCode ' ,
133
143
'network ' ,
134
144
'organization ' ,
135
145
'staticIpScore ' ,
Original file line number Diff line number Diff line change @@ -210,6 +210,10 @@ public function testEnterprise(): void
210
210
$ this ->assertSame ($ ipAddress , $ record ->traits ->ipAddress );
211
211
$ this ->assertSame ('74.209.16.0/20 ' , $ record ->traits ->network );
212
212
213
+ $ record = $ reader ->enterprise ('149.101.100.0 ' );
214
+ $ this ->assertSame ('310 ' , $ record ->traits ->mobileCountryCode );
215
+ $ this ->assertSame ('004 ' , $ record ->traits ->mobileNetworkCode );
216
+
213
217
$ reader ->close ();
214
218
}
215
219
@@ -231,6 +235,10 @@ public function testIsp(): void
231
235
$ this ->assertSame ($ ipAddress , $ record ->ipAddress );
232
236
$ this ->assertSame ('1.128.0.0/11 ' , $ record ->network );
233
237
238
+ $ record = $ reader ->isp ('149.101.100.0 ' );
239
+ $ this ->assertSame ('310 ' , $ record ->mobileCountryCode );
240
+ $ this ->assertSame ('004 ' , $ record ->mobileNetworkCode );
241
+
234
242
$ reader ->close ();
235
243
}
236
244
Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ public function testFull(): void
78
78
'is_satellite_provider ' => true ,
79
79
'is_tor_exit_node ' => true ,
80
80
'isp ' => 'Comcast ' ,
81
+ 'mobile_country_code ' => '310 ' ,
82
+ 'mobile_network_code ' => '004 ' ,
81
83
'organization ' => 'Blorg ' ,
82
84
'static_ip_score ' => 1.3 ,
83
85
'user_count ' => 2 ,
@@ -193,6 +195,18 @@ public function testFull(): void
193
195
'$model->traits->isAnonymousProxy is false '
194
196
);
195
197
198
+ $ this ->assertSame (
199
+ '310 ' ,
200
+ $ model ->traits ->mobileCountryCode ,
201
+ 'mobileCountryCode is correct '
202
+ );
203
+
204
+ $ this ->assertSame (
205
+ '004 ' ,
206
+ $ model ->traits ->mobileNetworkCode ,
207
+ 'mobileNetworkCode is correct '
208
+ );
209
+
196
210
$ this ->assertSame (
197
211
1.3 ,
198
212
$ model ->traits ->staticIpScore ,
You can’t perform that action at this time.
0 commit comments