diff --git a/lib/maxmind/GeoIp2/Compat/JsonSerializable.php b/lib/maxmind/GeoIp2/Compat/JsonSerializable.php deleted file mode 100644 index 4846ce71626..00000000000 --- a/lib/maxmind/GeoIp2/Compat/JsonSerializable.php +++ /dev/null @@ -1,27 +0,0 @@ -dbReader = new DbReader($filename); + $this->dbType = $this->dbReader->metadata()->databaseType; $this->locales = $locales; } @@ -212,9 +214,11 @@ class Reader implements ProviderInterface private function modelFor($class, $type, $ipAddress) { - $record = $this->getRecord($class, $type, $ipAddress); + list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress); $record['traits']['ip_address'] = $ipAddress; + $record['traits']['prefix_len'] = $prefixLen; + $class = 'GeoIp2\\Model\\' . $class; return new $class($record, $this->locales); @@ -222,9 +226,10 @@ class Reader implements ProviderInterface private function flatModelFor($class, $type, $ipAddress) { - $record = $this->getRecord($class, $type, $ipAddress); + list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress); $record['ip_address'] = $ipAddress; + $record['prefix_len'] = $prefixLen; $class = 'GeoIp2\\Model\\' . $class; return new $class($record); @@ -232,20 +237,19 @@ class Reader implements ProviderInterface private function getRecord($class, $type, $ipAddress) { - if (strpos($this->metadata()->databaseType, $type) === false) { + if (strpos($this->dbType, $type) === false) { $method = lcfirst($class); throw new \BadMethodCallException( - "The $method method cannot be used to open a " - . $this->metadata()->databaseType . ' database' + "The $method method cannot be used to open a {$this->dbType} database" ); } - $record = $this->dbReader->get($ipAddress); + list($record, $prefixLen) = $this->dbReader->getWithPrefixLen($ipAddress); if ($record === null) { throw new AddressNotFoundException( "The address $ipAddress is not in the database." ); } - if (!is_array($record)) { + if (!\is_array($record)) { // This can happen on corrupt databases. Generally, // MaxMind\Db\Reader will throw a // MaxMind\Db\Reader\InvalidDatabaseException, but occasionally @@ -255,11 +259,11 @@ class Reader implements ProviderInterface // exceptions go unnoticed. throw new InvalidDatabaseException( "Expected an array when looking up $ipAddress but received: " - . gettype($record) + . \gettype($record) ); } - return $record; + return [$record, $prefixLen]; } /** diff --git a/lib/maxmind/GeoIp2/Model/AnonymousIp.php b/lib/maxmind/GeoIp2/Model/AnonymousIp.php index bdaeb898105..a8f946ee865 100644 --- a/lib/maxmind/GeoIp2/Model/AnonymousIp.php +++ b/lib/maxmind/GeoIp2/Model/AnonymousIp.php @@ -2,21 +2,28 @@ namespace GeoIp2\Model; +use GeoIp2\Util; + /** * This class provides the GeoIP2 Anonymous IP model. * * @property-read bool $isAnonymous This is true if the IP address belongs to * any sort of anonymous network. - * @property-read bool $isAnonymousVpn This is true if the IP address belongs to - * an anonymous VPN system. + * @property-read bool $isAnonymousVpn This is true if the IP address is + * registered to an anonymous VPN provider. If a VPN provider does not + * register subnets under names associated with them, we will likely only + * flag their IP ranges using the isHostingProvider property. * @property-read bool $isHostingProvider This is true if the IP address belongs - * to a hosting provider. + * to a hosting or VPN provider (see description of isAnonymousVpn property). * @property-read bool $isPublicProxy This is true if the IP address belongs to * a public proxy. * @property-read bool $isTorExitNode This is true if the IP address is a Tor * exit node. * @property-read string $ipAddress The IP address that the data in the model is * for. + * @property-read string $network The network in CIDR notation associated with + * the record. In particular, this is the largest network where all of the + * fields besides $ipAddress have the same value. */ class AnonymousIp extends AbstractModel { @@ -26,6 +33,7 @@ class AnonymousIp extends AbstractModel protected $isPublicProxy; protected $isTorExitNode; protected $ipAddress; + protected $network; /** * @ignore @@ -41,6 +49,8 @@ class AnonymousIp extends AbstractModel $this->isHostingProvider = $this->get('is_hosting_provider'); $this->isPublicProxy = $this->get('is_public_proxy'); $this->isTorExitNode = $this->get('is_tor_exit_node'); - $this->ipAddress = $this->get('ip_address'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); } } diff --git a/lib/maxmind/GeoIp2/Model/Asn.php b/lib/maxmind/GeoIp2/Model/Asn.php index 4144142fe02..8e7c802eeba 100644 --- a/lib/maxmind/GeoIp2/Model/Asn.php +++ b/lib/maxmind/GeoIp2/Model/Asn.php @@ -2,6 +2,8 @@ namespace GeoIp2\Model; +use GeoIp2\Util; + /** * This class provides the GeoLite2 ASN model. * @@ -12,12 +14,16 @@ namespace GeoIp2\Model; * address. * @property-read string $ipAddress The IP address that the data in the model is * for. + * @property-read string $network The network in CIDR notation associated with + * the record. In particular, this is the largest network where all of the + * fields besides $ipAddress have the same value. */ class Asn extends AbstractModel { protected $autonomousSystemNumber; protected $autonomousSystemOrganization; protected $ipAddress; + protected $network; /** * @ignore @@ -30,6 +36,8 @@ class Asn extends AbstractModel $this->autonomousSystemNumber = $this->get('autonomous_system_number'); $this->autonomousSystemOrganization = $this->get('autonomous_system_organization'); - $this->ipAddress = $this->get('ip_address'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); } } diff --git a/lib/maxmind/GeoIp2/Model/City.php b/lib/maxmind/GeoIp2/Model/City.php index 32859035a1e..3e78c4f14c4 100644 --- a/lib/maxmind/GeoIp2/Model/City.php +++ b/lib/maxmind/GeoIp2/Model/City.php @@ -7,42 +7,25 @@ namespace GeoIp2\Model; * * The only difference between the City and Insights model classes is which * fields in each record may be populated. See - * http://dev.maxmind.com/geoip/geoip2/web-services more details. + * https://dev.maxmind.com/geoip/geoip2/web-services for more details. * * @property-read \GeoIp2\Record\City $city City data for the requested IP * address. - * @property-read \GeoIp2\Record\Continent $continent Continent data for the - * requested IP address. - * @property-read \GeoIp2\Record\Country $country Country data for the requested - * IP address. This object represents the country where MaxMind believes the - * end user is located. * @property-read \GeoIp2\Record\Location $location Location data for the * requested IP address. * @property-read \GeoIp2\Record\Postal $postal Postal data for the * requested IP address. - * @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind - * account. - * @property-read \GeoIp2\Record\Country $registeredCountry Registered country - * data for the requested IP address. This record represents the country - * where the ISP has registered a given IP block and may differ from the - * user's country. - * @property-read \GeoIp2\Record\RepresentedCountry $representedCountry - * Represented country data for the requested IP address. The represented - * country is used for things like military bases. It is only present when - * the represented country differs from the country. - * @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision} + * @property-read array $subdivisions An array \GeoIp2\Record\Subdivision * objects representing the country subdivisions for the requested IP * address. The number and type of subdivisions varies by country, but a * subdivision is typically a state, province, county, etc. Subdivisions * are ordered from most general (largest) to most specific (smallest). * If the response did not contain any subdivisions, this method returns * an empty array. - * @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object + * @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object * representing the most specific subdivision returned. If the response * did not contain any subdivisions, this method returns an empty - * {@link \GeoIp2\Record\Subdivision} object. - * @property-read \GeoIp2\Record\Traits $traits Data for the traits of the - * requested IP address. + * \GeoIp2\Record\Subdivision object. */ class City extends Country { diff --git a/lib/maxmind/GeoIp2/Model/ConnectionType.php b/lib/maxmind/GeoIp2/Model/ConnectionType.php index 169e7c11792..8091e26ce50 100644 --- a/lib/maxmind/GeoIp2/Model/ConnectionType.php +++ b/lib/maxmind/GeoIp2/Model/ConnectionType.php @@ -2,6 +2,8 @@ namespace GeoIp2\Model; +use GeoIp2\Util; + /** * This class provides the GeoIP2 Connection-Type model. * @@ -10,11 +12,15 @@ namespace GeoIp2\Model; * Additional values may be added in the future. * @property-read string $ipAddress The IP address that the data in the model is * for. + * @property-read string $network The network in CIDR notation associated with + * the record. In particular, this is the largest network where all of the + * fields besides $ipAddress have the same value. */ class ConnectionType extends AbstractModel { protected $connectionType; protected $ipAddress; + protected $network; /** * @ignore @@ -26,6 +32,8 @@ class ConnectionType extends AbstractModel parent::__construct($raw); $this->connectionType = $this->get('connection_type'); - $this->ipAddress = $this->get('ip_address'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); } } diff --git a/lib/maxmind/GeoIp2/Model/Country.php b/lib/maxmind/GeoIp2/Model/Country.php index 17833a152ca..a589d25f43f 100644 --- a/lib/maxmind/GeoIp2/Model/Country.php +++ b/lib/maxmind/GeoIp2/Model/Country.php @@ -7,7 +7,7 @@ namespace GeoIp2\Model; * * The only difference between the City and Insights model classes is which * fields in each record may be populated. See - * http://dev.maxmind.com/geoip/geoip2/web-services more details. + * https://dev.maxmind.com/geoip/geoip2/web-services for more details. * * @property-read \GeoIp2\Record\Continent $continent Continent data for the * requested IP address. diff --git a/lib/maxmind/GeoIp2/Model/Domain.php b/lib/maxmind/GeoIp2/Model/Domain.php index f452e866917..5e2cf346dde 100644 --- a/lib/maxmind/GeoIp2/Model/Domain.php +++ b/lib/maxmind/GeoIp2/Model/Domain.php @@ -2,6 +2,8 @@ namespace GeoIp2\Model; +use GeoIp2\Util; + /** * This class provides the GeoIP2 Domain model. * @@ -10,11 +12,15 @@ namespace GeoIp2\Model; * "example.co.uk", not "foo.example.com". * @property-read string $ipAddress The IP address that the data in the model is * for. + * @property-read string $network The network in CIDR notation associated with + * the record. In particular, this is the largest network where all of the + * fields besides $ipAddress have the same value. */ class Domain extends AbstractModel { protected $domain; protected $ipAddress; + protected $network; /** * @ignore @@ -26,6 +32,8 @@ class Domain extends AbstractModel parent::__construct($raw); $this->domain = $this->get('domain'); - $this->ipAddress = $this->get('ip_address'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); } } diff --git a/lib/maxmind/GeoIp2/Model/Enterprise.php b/lib/maxmind/GeoIp2/Model/Enterprise.php index 6b98c0553de..c50fb81db70 100644 --- a/lib/maxmind/GeoIp2/Model/Enterprise.php +++ b/lib/maxmind/GeoIp2/Model/Enterprise.php @@ -7,40 +7,7 @@ namespace GeoIp2\Model; * * The only difference between the City and Enterprise model classes is which * fields in each record may be populated. See - * http://dev.maxmind.com/geoip/geoip2/web-services more details. - * - * @property-read \GeoIp2\Record\City $city City data for the requested IP - * address. - * @property-read \GeoIp2\Record\Continent $continent Continent data for the - * requested IP address. - * @property-read \GeoIp2\Record\Country $country Country data for the requested - * IP address. This object represents the country where MaxMind believes the - * end user is located. - * @property-read \GeoIp2\Record\Location $location Location data for the - * requested IP address. - * @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind - * account. - * @property-read \GeoIp2\Record\Country $registeredCountry Registered country - * data for the requested IP address. This record represents the country - * where the ISP has registered a given IP block and may differ from the - * user's country. - * @property-read \GeoIp2\Record\RepresentedCountry $representedCountry - * Represented country data for the requested IP address. The represented - * country is used for things like military bases. It is only present when - * the represented country differs from the country. - * @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision} - * objects representing the country subdivisions for the requested IP - * address. The number and type of subdivisions varies by country, but a - * subdivision is typically a state, province, county, etc. Subdivisions - * are ordered from most general (largest) to most specific (smallest). - * If the response did not contain any subdivisions, this method returns - * an empty array. - * @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object - * representing the most specific subdivision returned. If the response - * did not contain any subdivisions, this method returns an empty - * {@link \GeoIp2\Record\Subdivision} object. - * @property-read \GeoIp2\Record\Traits $traits Data for the traits of the - * requested IP address. + * https://dev.maxmind.com/geoip/geoip2/web-services for more details. */ class Enterprise extends City { diff --git a/lib/maxmind/GeoIp2/Model/Insights.php b/lib/maxmind/GeoIp2/Model/Insights.php index cefcfb916c9..61beb2ed6e3 100644 --- a/lib/maxmind/GeoIp2/Model/Insights.php +++ b/lib/maxmind/GeoIp2/Model/Insights.php @@ -7,40 +7,7 @@ namespace GeoIp2\Model; * * The only difference between the City and Insights model classes is which * fields in each record may be populated. See - * http://dev.maxmind.com/geoip/geoip2/web-services more details. - * - * @property-read \GeoIp2\Record\City $city City data for the requested IP - * address. - * @property-read \GeoIp2\Record\Continent $continent Continent data for the - * requested IP address. - * @property-read \GeoIp2\Record\Country $country Country data for the requested - * IP address. This object represents the country where MaxMind believes the - * end user is located. - * @property-read \GeoIp2\Record\Location $location Location data for the - * requested IP address. - * @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind - * account. - * @property-read \GeoIp2\Record\Country $registeredCountry Registered country - * data for the requested IP address. This record represents the country - * where the ISP has registered a given IP block and may differ from the - * user's country. - * @property-read \GeoIp2\Record\RepresentedCountry $representedCountry - * Represented country data for the requested IP address. The represented - * country is used for things like military bases. It is only present when - * the represented country differs from the country. - * @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision} - * objects representing the country subdivisions for the requested IP - * address. The number and type of subdivisions varies by country, but a - * subdivision is typically a state, province, county, etc. Subdivisions - * are ordered from most general (largest) to most specific (smallest). - * If the response did not contain any subdivisions, this method returns - * an empty array. - * @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object - * representing the most specific subdivision returned. If the response - * did not contain any subdivisions, this method returns an empty - * {@link \GeoIp2\Record\Subdivision} object. - * @property-read \GeoIp2\Record\Traits $traits Data for the traits of the - * requested IP address. + * https://dev.maxmind.com/geoip/geoip2/web-services for more details. */ class Insights extends City { diff --git a/lib/maxmind/GeoIp2/Model/Isp.php b/lib/maxmind/GeoIp2/Model/Isp.php index 51e0b680ecb..1a7b5153880 100644 --- a/lib/maxmind/GeoIp2/Model/Isp.php +++ b/lib/maxmind/GeoIp2/Model/Isp.php @@ -2,6 +2,8 @@ namespace GeoIp2\Model; +use GeoIp2\Util; + /** * This class provides the GeoIP2 ISP model. * @@ -16,6 +18,9 @@ namespace GeoIp2\Model; * with the IP address. * @property-read string $ipAddress The IP address that the data in the model is * for. + * @property-read string $network The network in CIDR notation associated with + * the record. In particular, this is the largest network where all of the + * fields besides $ipAddress have the same value. */ class Isp extends AbstractModel { @@ -24,6 +29,7 @@ class Isp extends AbstractModel protected $isp; protected $organization; protected $ipAddress; + protected $network; /** * @ignore @@ -39,6 +45,8 @@ class Isp extends AbstractModel $this->isp = $this->get('isp'); $this->organization = $this->get('organization'); - $this->ipAddress = $this->get('ip_address'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); } } diff --git a/lib/maxmind/GeoIp2/Record/AbstractRecord.php b/lib/maxmind/GeoIp2/Record/AbstractRecord.php index 5d8cb0bf10d..dad2fd3f376 100644 --- a/lib/maxmind/GeoIp2/Record/AbstractRecord.php +++ b/lib/maxmind/GeoIp2/Record/AbstractRecord.php @@ -51,7 +51,7 @@ abstract class AbstractRecord implements \JsonSerializable private function validAttribute($attr) { - return in_array($attr, $this->validAttributes, true); + return \in_array($attr, $this->validAttributes, true); } public function jsonSerialize() diff --git a/lib/maxmind/GeoIp2/Record/Country.php b/lib/maxmind/GeoIp2/Record/Country.php index 477bc1d63f1..ff9ecc7cd02 100644 --- a/lib/maxmind/GeoIp2/Record/Country.php +++ b/lib/maxmind/GeoIp2/Record/Country.php @@ -15,10 +15,9 @@ namespace GeoIp2\Record; * @property-read bool $isInEuropeanUnion This is true if the country is a * member state of the European Union. This attribute is returned by all * location services and databases. - * @property-read string|null $isoCode The - * {@link * http://en.wikipedia.org/wiki/ISO_3166-1 two-character ISO 3166-1 alpha - * code} for the country. This attribute is returned by all location services - * and databases. + * @property-read string|null $isoCode The two-character ISO 3166-1 alpha code + * for the country. See https://en.wikipedia.org/wiki/ISO_3166-1. This + * attribute is returned by all location services and databases. * @property-read string|null $name The name of the country based on the locales * list passed to the constructor. This attribute is returned by all location * services and databases. diff --git a/lib/maxmind/GeoIp2/Record/Location.php b/lib/maxmind/GeoIp2/Record/Location.php index 9b81adf33e4..b59b3ee70c1 100644 --- a/lib/maxmind/GeoIp2/Record/Location.php +++ b/lib/maxmind/GeoIp2/Record/Location.php @@ -27,11 +27,11 @@ namespace GeoIp2\Record; * from the Insights service. * @property-read int|null $metroCode The metro code of the location if the location * is in the US. MaxMind returns the same metro codes as the - * {@link * https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions - * Google AdWords API}. + * Google AdWords API. See + * https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions. * @property-read string|null $timeZone The time zone associated with location, as - * specified by the {@link http://www.iana.org/time-zones IANA Time Zone - * Database}, e.g., "America/New_York". + * specified by the IANA Time Zone Database, e.g., "America/New_York". See + * https://www.iana.org/time-zones. */ class Location extends AbstractRecord { diff --git a/lib/maxmind/GeoIp2/Record/RepresentedCountry.php b/lib/maxmind/GeoIp2/Record/RepresentedCountry.php index 13082dd0fb7..bc79ee15742 100644 --- a/lib/maxmind/GeoIp2/Record/RepresentedCountry.php +++ b/lib/maxmind/GeoIp2/Record/RepresentedCountry.php @@ -9,19 +9,6 @@ namespace GeoIp2\Record; * for the IP's represented country. The represented country is the country * represented by something like a military base. * - * @property-read int|null $confidence A value from 0-100 indicating MaxMind's - * confidence that the country is correct. This attribute is only available - * from the Insights service and the GeoIP2 Enterprise database. - * @property-read int|null $geonameId The GeoName ID for the country. - * @property-read bool $isInEuropeanUnion This is true if the country is a - * member state of the European Union. This attribute is returned by all - * location services and databases. - * @property-read string|null $isoCode The {@link http://en.wikipedia.org/wiki/ISO_3166-1 - * two-character ISO 3166-1 alpha code} for the country. - * @property-read string|null $name The name of the country based on the locales list - * passed to the constructor. - * @property-read array|null $names An array map where the keys are locale codes and - * the values are names. * @property-read string|null $type A string indicating the type of entity that is * representing the country. Currently we only return military * but this could expand to include other types in the future. diff --git a/lib/maxmind/GeoIp2/Record/Subdivision.php b/lib/maxmind/GeoIp2/Record/Subdivision.php index 386c68d8fa7..74ae3e2caad 100644 --- a/lib/maxmind/GeoIp2/Record/Subdivision.php +++ b/lib/maxmind/GeoIp2/Record/Subdivision.php @@ -16,9 +16,9 @@ namespace GeoIp2\Record; * This attribute is returned by all location databases and services besides * Country. * @property-read string|null $isoCode This is a string up to three characters long - * contain the subdivision portion of the - * {@link * http://en.wikipedia.org/wiki/ISO_3166-2 ISO 3166-2 code}. This attribute - * is returned by all location databases and services except Country. + * contain the subdivision portion of the ISO 3166-2 code. See + * https://en.wikipedia.org/wiki/ISO_3166-2. This attribute is returned by all + * location databases and services except Country. * @property-read string|null $name The name of the subdivision based on the * locales list passed to the constructor. This attribute is returned by all * location databases and services besides Country. diff --git a/lib/maxmind/GeoIp2/Record/Traits.php b/lib/maxmind/GeoIp2/Record/Traits.php index bc5f07d547c..e6b798f41ca 100644 --- a/lib/maxmind/GeoIp2/Record/Traits.php +++ b/lib/maxmind/GeoIp2/Record/Traits.php @@ -2,21 +2,23 @@ namespace GeoIp2\Record; +use GeoIp2\Util; + /** * Contains data for the traits record associated with an IP address. * * This record is returned by all location services and databases. * - * @property-read int|null $autonomousSystemNumber The - * {@link * http://en.wikipedia.org/wiki/Autonomous_system_(Internet) autonomous - * system number} associated with the IP address. This attribute is only - * available from the City and Insights web service and the GeoIP2 + * @property-read int|null $autonomousSystemNumber The autonomous system number + * associated with the IP address. See + * https://en.wikipedia.org/wiki/Autonomous_system_(Internet%29. This attribute + * is only available from the City and Insights web service and the GeoIP2 * Enterprise database. * @property-read string|null $autonomousSystemOrganization The organization - * associated with the registered {@link * http://en.wikipedia.org/wiki/Autonomous_system_(Internet) autonomous - * system number} for the IP address. This attribute is only available from - * the City and Insights web service and the GeoIP2 Enterprise - * database. + * associated with the registered autonomous system number for the IP address. + * See https://en.wikipedia.org/wiki/Autonomous_system_(Internet%29. This + * attribute is only available from the City and Insights web service and the + * GeoIP2 Enterprise database. * @property-read string|null $connectionType The connection type may take the * following values: "Dialup", "Cable/DSL", "Corporate", "Cellular". * Additional values may be added in the future. This attribute is only @@ -35,16 +37,18 @@ namespace GeoIp2\Record; * @property-read bool $isAnonymous This is true if the IP address belongs to * any sort of anonymous network. This property is only available from GeoIP2 * Precision Insights. - * @property-read bool $isAnonymousProxy *Deprecated.* Please see our - * {@link * https://www.maxmind.com/en/geoip2-anonymous-ip-database GeoIP2 - * Anonymous IP database} to determine whether the IP address is used by an - * anonymizing service. - * @property-read bool $isAnonymousVpn This is true if the IP address belongs to - * an anonymous VPN system. This property is only available from GeoIP2 - * Precision Insights. + * @property-read bool $isAnonymousProxy *Deprecated.* Please see our GeoIP2 + * Anonymous IP database + * (https://www.maxmind.com/en/geoip2-anonymous-ip-database) to determine + * whether the IP address is used by an anonymizing service. + * @property-read bool $isAnonymousVpn This is true if the IP address is + * registered to an anonymous VPN provider. If a VPN provider does not register + * subnets under names associated with them, we will likely only flag their IP + * ranges using the isHostingProvider property. This property is only available + * from GeoIP2 Precision Insights. * @property-read bool $isHostingProvider This is true if the IP address belongs - * to a hosting provider. This property is only available from GeoIP2 - * Precision Insights. + * to a hosting or VPN provider (see description of isAnonymousVpn property). + * This property is only available from GeoIP2 Precision Insights. * @property-read bool $isLegitimateProxy This attribute is true if MaxMind * believes this IP address to be a legitimate proxy, such as an internal * VPN used by a corporation. This attribute is only available in the GeoIP2 @@ -61,9 +65,19 @@ namespace GeoIp2\Record; * @property-read string|null $isp The name of the ISP associated with the IP * address. This attribute is only available from the City and Insights web * services and the GeoIP2 Enterprise database. + * @property-read string $network The network in CIDR notation associated with + * the record. In particular, this is the largest network where all of the + * fields besides $ipAddress have the same value. * @property-read string|null $organization The name of the organization associated * with the IP address. This attribute is only available from the City and * Insights web services and the GeoIP2 Enterprise database. + * @property-read float|null $staticIPScore An indicator of how static or + * dynamic an IP address is. This property is only available from GeoIP2 + * Precision Insights. + * @property-read int|null $userCount The estimated number of users sharing + * the IP/network during the past 24 hours. For IPv4, the count is for the + * individual IP. For IPv6, the count is for the /64 network. This property is + * only available from GeoIP2 Precision Insights. * @property-read string|null $userType

The user type associated with the IP * address. This can be one of the following values:

*