Skip to content

Commit 59aab5d

Browse files
committed
Remove deprecated properties
1 parent 442d0a2 commit 59aab5d

File tree

4 files changed

+2
-49
lines changed

4 files changed

+2
-49
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ CHANGELOG
99
classes rather than magic methods. This significantly improves performance.
1010
* BREAKING: The `raw` property on model classess and the `record` property on
1111
record classes have been removed.
12+
* BREAKING: On `GeoIp2\Record\Traits`, the deprecated `isAnonymousProxy` and
13+
`isSatelliteProvider` properties have been removed.
1214
* BREAKING: The `jsonSerialize` output has changed.
1315
* `GeoIp2\WebService\Client` methods now throw an `InvalidArgumentException`
1416
if an invalid IP address is passed to them. Previously, they would make

src/Record/Traits.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ class Traits implements \JsonSerializable
6666
*/
6767
public readonly bool $isAnonymous;
6868

69-
/**
70-
* @var bool *Deprecated.* Please see our GeoIP2
71-
* Anonymous IP database
72-
* (https://www.maxmind.com/en/geoip2-anonymous-ip-database) to determine
73-
* whether the IP address is used by an anonymizing service.
74-
*
75-
* @deprecated
76-
*/
77-
public readonly bool $isAnonymousProxy;
78-
7969
/**
8070
* @var bool This is true if the IP address is
8171
* registered to an anonymous VPN provider. If a VPN provider does not register
@@ -113,16 +103,6 @@ class Traits implements \JsonSerializable
113103
*/
114104
public readonly bool $isResidentialProxy;
115105

116-
/**
117-
* @var bool *Deprecated.* Due to the
118-
* increased coverage by mobile carriers, very few satellite providers now
119-
* serve multiple countries. As a result, the output does not provide
120-
* sufficiently relevant data for us to maintain it.
121-
*
122-
* @deprecated
123-
*/
124-
public readonly bool $isSatelliteProvider;
125-
126106
/**
127107
* @var bool This is true if the IP address is a Tor
128108
* exit node. This property is only available from GeoIP2 Insights.
@@ -217,14 +197,12 @@ public function __construct(array $record)
217197
$this->domain = $record['domain'] ?? null;
218198
$this->ipAddress = $record['ip_address'] ?? null;
219199
$this->isAnonymous = $record['is_anonymous'] ?? false;
220-
$this->isAnonymousProxy = $record['is_anonymous_proxy'] ?? false;
221200
$this->isAnonymousVpn = $record['is_anonymous_vpn'] ?? false;
222201
$this->isHostingProvider = $record['is_hosting_provider'] ?? false;
223202
$this->isLegitimateProxy = $record['is_legitimate_proxy'] ?? false;
224203
$this->isp = $record['isp'] ?? null;
225204
$this->isPublicProxy = $record['is_public_proxy'] ?? false;
226205
$this->isResidentialProxy = $record['is_residential_proxy'] ?? false;
227-
$this->isSatelliteProvider = $record['is_satellite_provider'] ?? false;
228206
$this->isTorExitNode = $record['is_tor_exit_node'] ?? false;
229207
$this->mobileCountryCode = $record['mobile_country_code'] ?? null;
230208
$this->mobileNetworkCode = $record['mobile_network_code'] ?? null;
@@ -261,9 +239,6 @@ public function jsonSerialize(): array
261239
if ($this->isAnonymous !== false) {
262240
$js['is_anonymous'] = $this->isAnonymous;
263241
}
264-
if ($this->isAnonymousProxy !== false) {
265-
$js['is_anonymous_proxy'] = $this->isAnonymousProxy;
266-
}
267242
if ($this->isAnonymousVpn !== false) {
268243
$js['is_anonymous_vpn'] = $this->isAnonymousVpn;
269244
}
@@ -279,9 +254,6 @@ public function jsonSerialize(): array
279254
if ($this->isResidentialProxy !== false) {
280255
$js['is_residential_proxy'] = $this->isResidentialProxy;
281256
}
282-
if ($this->isSatelliteProvider !== false) {
283-
$js['is_satellite_provider'] = $this->isSatelliteProvider;
284-
}
285257
if ($this->isTorExitNode !== false) {
286258
$js['is_tor_exit_node'] = $this->isTorExitNode;
287259
}

tests/GeoIp2/Test/Model/CountryTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ public function testValues(): void
164164
$this->model->registeredCountry->name,
165165
'registered_country name is Germany'
166166
);
167-
168-
foreach (['isAnonymousProxy', 'isSatelliteProvider'] as $meth) {
169-
$this->assertFalse(
170-
$this->model->traits->{$meth},
171-
"traits $meth returns 0 by default"
172-
);
173-
}
174167
}
175168

176169
public function testJsonSerialize(): void

tests/GeoIp2/Test/Model/InsightsTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,11 @@ public function testFull(): void
7575
'domain' => 'example.com',
7676
'ip_address' => '1.2.3.4',
7777
'is_anonymous' => true,
78-
'is_anonymous_proxy' => true,
7978
'is_anonymous_vpn' => true,
8079
'is_hosting_provider' => true,
8180
'is_legitimate_proxy' => true,
8281
'is_public_proxy' => true,
8382
'is_residential_proxy' => true,
84-
'is_satellite_provider' => true,
8583
'is_tor_exit_node' => true,
8684
'isp' => 'Comcast',
8785
'mobile_country_code' => '310',
@@ -187,21 +185,11 @@ public function testFull(): void
187185
'$model->traits->isResidentialProxy is true'
188186
);
189187

190-
$this->assertTrue(
191-
$model->traits->isSatelliteProvider,
192-
'$model->traits->isSatelliteProvider is true'
193-
);
194-
195188
$this->assertTrue(
196189
$model->traits->isTorExitNode,
197190
'$model->traits->isTorExitNode is true'
198191
);
199192

200-
$this->assertTrue(
201-
$model->traits->isAnonymousProxy,
202-
'$model->traits->isAnonymousProxy is true'
203-
);
204-
205193
$this->assertSame(
206194
'310',
207195
$model->traits->mobileCountryCode,
@@ -266,13 +254,11 @@ public function testFull(): void
266254
'domain' => 'example.com',
267255
'ip_address' => '1.2.3.4',
268256
'is_anonymous' => true,
269-
'is_anonymous_proxy' => true,
270257
'is_anonymous_vpn' => true,
271258
'is_hosting_provider' => true,
272259
'is_legitimate_proxy' => true,
273260
'is_public_proxy' => true,
274261
'is_residential_proxy' => true,
275-
'is_satellite_provider' => true,
276262
'is_tor_exit_node' => true,
277263
'isp' => 'Comcast',
278264
'mobile_country_code' => '310',

0 commit comments

Comments
 (0)