Skip to content

Commit 442d0a2

Browse files
committed
Move docs to the properties
Previously this was not possible as we were using magic methods.
1 parent dc20c43 commit 442d0a2

18 files changed

+476
-322
lines changed

src/Model/AnonymousIp.php

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,58 @@
88

99
/**
1010
* This class provides the GeoIP2 Anonymous IP model.
11-
*
12-
* @property-read bool $isAnonymous This is true if the IP address belongs to
13-
* any sort of anonymous network.
14-
* @property-read bool $isAnonymousVpn This is true if the IP address is
15-
* registered to an anonymous VPN provider. If a VPN provider does not
16-
* register subnets under names associated with them, we will likely only
17-
* flag their IP ranges using the isHostingProvider property.
18-
* @property-read bool $isHostingProvider This is true if the IP address belongs
19-
* to a hosting or VPN provider (see description of isAnonymousVpn property).
20-
* @property-read bool $isPublicProxy This is true if the IP address belongs to
21-
* a public proxy.
22-
* @property-read bool $isResidentialProxy This is true if the IP address is
23-
* on a suspected anonymizing network and belongs to a residential ISP.
24-
* @property-read bool $isTorExitNode This is true if the IP address is a Tor
25-
* exit node.
26-
* @property-read string $ipAddress The IP address that the data in the model is
27-
* for.
28-
* @property-read string $network The network in CIDR notation associated with
29-
* the record. In particular, this is the largest network where all of the
30-
* fields besides $ipAddress have the same value.
3111
*/
3212
class AnonymousIp implements \JsonSerializable
3313
{
14+
/**
15+
* @var bool this is true if the IP address belongs to
16+
* any sort of anonymous network
17+
*/
3418
public readonly bool $isAnonymous;
19+
20+
/**
21+
* @var bool This is true if the IP address is
22+
* registered to an anonymous VPN provider. If a VPN provider does not
23+
* register subnets under names associated with them, we will likely only
24+
* flag their IP ranges using the isHostingProvider property.
25+
*/
3526
public readonly bool $isAnonymousVpn;
27+
28+
/**
29+
* @var bool this is true if the IP address belongs
30+
* to a hosting or VPN provider (see description of isAnonymousVpn property)
31+
*/
3632
public readonly bool $isHostingProvider;
33+
34+
/**
35+
* @var bool this is true if the IP address belongs to
36+
* a public proxy
37+
*/
3738
public readonly bool $isPublicProxy;
39+
40+
/**
41+
* @var bool this is true if the IP address is
42+
* on a suspected anonymizing network and belongs to a residential ISP
43+
*/
3844
public readonly bool $isResidentialProxy;
45+
46+
/**
47+
* @var bool this is true if the IP address is a Tor
48+
* exit node
49+
*/
3950
public readonly bool $isTorExitNode;
51+
52+
/**
53+
* @var string the IP address that the data in the model is
54+
* for
55+
*/
4056
public readonly string $ipAddress;
57+
58+
/**
59+
* @var string The network in CIDR notation associated with
60+
* the record. In particular, this is the largest network where all of the
61+
* fields besides $ipAddress have the same value.
62+
*/
4163
public readonly string $network;
4264

4365
/**

src/Model/Asn.php

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,33 @@
88

99
/**
1010
* This class provides the GeoLite2 ASN model.
11-
*
12-
* @property-read int|null $autonomousSystemNumber The autonomous system number
13-
* associated with the IP address.
14-
* @property-read string|null $autonomousSystemOrganization The organization
15-
* associated with the registered autonomous system number for the IP
16-
* address.
17-
* @property-read string $ipAddress The IP address that the data in the model is
18-
* for.
19-
* @property-read string $network The network in CIDR notation associated with
20-
* the record. In particular, this is the largest network where all of the
21-
* fields besides $ipAddress have the same value.
2211
*/
2312
class Asn implements \JsonSerializable
2413
{
14+
/**
15+
* @var int|null the autonomous system number
16+
* associated with the IP address
17+
*/
2518
public readonly ?int $autonomousSystemNumber;
19+
20+
/**
21+
* @var string|null the organization
22+
* associated with the registered autonomous system number for the IP
23+
* address
24+
*/
2625
public readonly ?string $autonomousSystemOrganization;
26+
27+
/**
28+
* @var string the IP address that the data in the model is
29+
* for
30+
*/
2731
public readonly string $ipAddress;
32+
33+
/**
34+
* @var string The network in CIDR notation associated with
35+
* the record. In particular, this is the largest network where all of the
36+
* fields besides $ipAddress have the same value.
37+
*/
2838
public readonly string $network;
2939

3040
/**

src/Model/City.php

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,49 @@
44

55
namespace GeoIp2\Model;
66

7-
use GeoIp2\Record\Subdivision;
8-
97
/**
108
* Model class for the data returned by City Plus web service and City
119
* database.
1210
*
1311
* See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more
1412
* details.
15-
*
16-
* @property-read \GeoIp2\Record\City $city City data for the requested IP
17-
* address.
18-
* @property-read \GeoIp2\Record\Location $location Location data for the
19-
* requested IP address.
20-
* @property-read \GeoIp2\Record\Postal $postal Postal data for the
21-
* requested IP address.
22-
* @property-read array $subdivisions An array \GeoIp2\Record\Subdivision
23-
* objects representing the country subdivisions for the requested IP
24-
* address. The number and type of subdivisions varies by country, but a
25-
* subdivision is typically a state, province, county, etc. Subdivisions
26-
* are ordered from most general (largest) to most specific (smallest).
27-
* If the response did not contain any subdivisions, this method returns
28-
* an empty array.
29-
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
30-
* representing the most specific subdivision returned. If the response
31-
* did not contain any subdivisions, this method returns an empty
32-
* \GeoIp2\Record\Subdivision object.
3313
*/
3414
class City extends Country
3515
{
3616
/**
37-
* @ignore
17+
* @var \GeoIp2\Record\City city data for the requested IP
18+
* address
3819
*/
3920
public readonly \GeoIp2\Record\City $city;
4021

4122
/**
42-
* @ignore
23+
* @var \GeoIp2\Record\Location location data for the
24+
* requested IP address
4325
*/
4426
public readonly \GeoIp2\Record\Location $location;
4527

4628
/**
47-
* @ignore
29+
* @var \GeoIp2\Record\Subdivision An object
30+
* representing the most specific subdivision returned. If the response
31+
* did not contain any subdivisions, this method returns an empty
32+
* \GeoIp2\Record\Subdivision object.
4833
*/
4934
public readonly \GeoIp2\Record\Subdivision $mostSpecificSubdivision;
5035

5136
/**
52-
* @ignore
37+
* @var \GeoIp2\Record\Postal postal data for the
38+
* requested IP address
5339
*/
5440
public readonly \GeoIp2\Record\Postal $postal;
5541

5642
/**
57-
* @ignore
58-
*
59-
* @var array<\GeoIp2\Record\Subdivision>
43+
* @var array<\GeoIp2\Record\Subdivision> An array of \GeoIp2\Record\Subdivision
44+
* objects representing the country subdivisions for the requested IP
45+
* address. The number and type of subdivisions varies by country, but a
46+
* subdivision is typically a state, province, county, etc. Subdivisions
47+
* are ordered from most general (largest) to most specific (smallest).
48+
* If the response did not contain any subdivisions, this method returns
49+
* an empty array.
6050
*/
6151
public readonly array $subdivisions;
6252

src/Model/ConnectionType.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,27 @@
88

99
/**
1010
* This class provides the GeoIP2 Connection-Type model.
11-
*
12-
* @property-read string|null $connectionType The connection type may take the
13-
* following values: "Dialup", "Cable/DSL", "Corporate", "Cellular", and
14-
* "Satellite". Additional values may be added in the future.
15-
* @property-read string $ipAddress The IP address that the data in the model is
16-
* for.
17-
* @property-read string $network The network in CIDR notation associated with
18-
* the record. In particular, this is the largest network where all of the
19-
* fields besides $ipAddress have the same value.
2011
*/
2112
class ConnectionType implements \JsonSerializable
2213
{
14+
/**
15+
* @var string|null The connection type may take the
16+
* following values: "Dialup", "Cable/DSL", "Corporate", "Cellular", and
17+
* "Satellite". Additional values may be added in the future.
18+
*/
2319
public readonly ?string $connectionType;
20+
21+
/**
22+
* @var string the IP address that the data in the model is
23+
* for
24+
*/
2425
public readonly string $ipAddress;
26+
27+
/**
28+
* @var string The network in CIDR notation associated with
29+
* the record. In particular, this is the largest network where all of the
30+
* fields besides $ipAddress have the same value.
31+
*/
2532
public readonly string $network;
2633

2734
/**

src/Model/Country.php

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,47 @@
88
* Model class for the data returned by GeoIP2 Country web service and database.
99
*
1010
* See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more details.
11-
*
12-
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
13-
* requested IP address.
14-
* @property-read \GeoIp2\Record\Country $country Country data for the requested
15-
* IP address. This object represents the country where MaxMind believes the
16-
* end user is located.
17-
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
18-
* account.
19-
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
20-
* data for the requested IP address. This record represents the country
21-
* where the ISP has registered a given IP block and may differ from the
22-
* user's country.
23-
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
24-
* Represented country data for the requested IP address. The represented
25-
* country is used for things like military bases. It is only present when
26-
* the represented country differs from the country.
27-
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
28-
* requested IP address.
2911
*/
3012
class Country implements \JsonSerializable
3113
{
14+
/**
15+
* @var \GeoIp2\Record\Continent continent data for the
16+
* requested IP address
17+
*/
3218
public readonly \GeoIp2\Record\Continent $continent;
19+
20+
/**
21+
* @var \GeoIp2\Record\Country Country data for the requested
22+
* IP address. This object represents the country where MaxMind believes the
23+
* end user is located.
24+
*/
3325
public readonly \GeoIp2\Record\Country $country;
26+
27+
/**
28+
* @var \GeoIp2\Record\MaxMind data related to your MaxMind
29+
* account
30+
*/
3431
public readonly \GeoIp2\Record\MaxMind $maxmind;
32+
33+
/**
34+
* @var \GeoIp2\Record\Country Registered country
35+
* data for the requested IP address. This record represents the country
36+
* where the ISP has registered a given IP block and may differ from the
37+
* user's country.
38+
*/
3539
public readonly \GeoIp2\Record\Country $registeredCountry;
40+
41+
/**
42+
* @var \GeoIp2\Record\RepresentedCountry * Represented country data for the requested IP address. The represented
43+
* country is used for things like military bases. It is only present when
44+
* the represented country differs from the country.
45+
*/
3646
public readonly \GeoIp2\Record\RepresentedCountry $representedCountry;
47+
48+
/**
49+
* @var \GeoIp2\Record\Traits data for the traits of the
50+
* requested IP address
51+
*/
3752
public readonly \GeoIp2\Record\Traits $traits;
3853

3954
/**

src/Model/Domain.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,27 @@
88

99
/**
1010
* This class provides the GeoIP2 Domain model.
11-
*
12-
* @property-read string|null $domain The second level domain associated with the
13-
* IP address. This will be something like "example.com" or
14-
* "example.co.uk", not "foo.example.com".
15-
* @property-read string $ipAddress The IP address that the data in the model is
16-
* for.
17-
* @property-read string $network The network in CIDR notation associated with
18-
* the record. In particular, this is the largest network where all of the
19-
* fields besides $ipAddress have the same value.
2011
*/
2112
class Domain implements \JsonSerializable
2213
{
14+
/**
15+
* @var string|null The second level domain associated with the
16+
* IP address. This will be something like "example.com" or
17+
* "example.co.uk", not "foo.example.com".
18+
*/
2319
public readonly ?string $domain;
20+
21+
/**
22+
* @var string the IP address that the data in the model is
23+
* for
24+
*/
2425
public readonly string $ipAddress;
26+
27+
/**
28+
* @var string The network in CIDR notation associated with
29+
* the record. In particular, this is the largest network where all of the
30+
* fields besides $ipAddress have the same value.
31+
*/
2532
public readonly string $network;
2633

2734
/**

0 commit comments

Comments
 (0)