summaryrefslogtreecommitdiffstats
path: root/vendor/geoip2/geoip2/src/Model
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/geoip2/geoip2/src/Model/AbstractModel.php27
-rw-r--r--vendor/geoip2/geoip2/src/Model/AnonymousIp.php41
-rw-r--r--vendor/geoip2/geoip2/src/Model/Asn.php21
-rw-r--r--vendor/geoip2/geoip2/src/Model/City.php45
-rw-r--r--vendor/geoip2/geoip2/src/Model/ConnectionType.php17
-rw-r--r--vendor/geoip2/geoip2/src/Model/Country.php39
-rw-r--r--vendor/geoip2/geoip2/src/Model/Domain.php17
-rw-r--r--vendor/geoip2/geoip2/src/Model/Enterprise.php7
-rw-r--r--vendor/geoip2/geoip2/src/Model/Insights.php9
-rw-r--r--vendor/geoip2/geoip2/src/Model/Isp.php47
10 files changed, 209 insertions, 61 deletions
diff --git a/vendor/geoip2/geoip2/src/Model/AbstractModel.php b/vendor/geoip2/geoip2/src/Model/AbstractModel.php
index 50f24b0..ba8dd84 100644
--- a/vendor/geoip2/geoip2/src/Model/AbstractModel.php
+++ b/vendor/geoip2/geoip2/src/Model/AbstractModel.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
/**
@@ -7,14 +9,15 @@ namespace GeoIp2\Model;
*/
abstract class AbstractModel implements \JsonSerializable
{
+ /**
+ * @var array<string, mixed>
+ */
protected $raw;
/**
* @ignore
- *
- * @param mixed $raw
*/
- public function __construct($raw)
+ public function __construct(array $raw)
{
$this->raw = $raw;
}
@@ -22,9 +25,9 @@ abstract class AbstractModel implements \JsonSerializable
/**
* @ignore
*
- * @param mixed $field
+ * @return mixed
*/
- protected function get($field)
+ protected function get(string $field)
{
if (isset($this->raw[$field])) {
return $this->raw[$field];
@@ -39,12 +42,12 @@ abstract class AbstractModel implements \JsonSerializable
/**
* @ignore
*
- * @param mixed $attr
+ * @return mixed
*/
- public function __get($attr)
+ public function __get(string $attr)
{
if ($attr !== 'instance' && property_exists($this, $attr)) {
- return $this->$attr;
+ return $this->{$attr};
}
throw new \RuntimeException("Unknown attribute: $attr");
@@ -52,15 +55,13 @@ abstract class AbstractModel implements \JsonSerializable
/**
* @ignore
- *
- * @param mixed $attr
*/
- public function __isset($attr)
+ public function __isset(string $attr): bool
{
- return $attr !== 'instance' && isset($this->$attr);
+ return $attr !== 'instance' && isset($this->{$attr});
}
- public function jsonSerialize()
+ public function jsonSerialize(): array
{
return $this->raw;
}
diff --git a/vendor/geoip2/geoip2/src/Model/AnonymousIp.php b/vendor/geoip2/geoip2/src/Model/AnonymousIp.php
index bf05b88..fb927ab 100644
--- a/vendor/geoip2/geoip2/src/Model/AnonymousIp.php
+++ b/vendor/geoip2/geoip2/src/Model/AnonymousIp.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
use GeoIp2\Util;
@@ -17,6 +19,8 @@ use GeoIp2\Util;
* 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 $isResidentialProxy This is true if the IP address is
+ * on a suspected anonymizing network and belongs to a residential ISP.
* @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
@@ -27,20 +31,50 @@ use GeoIp2\Util;
*/
class AnonymousIp extends AbstractModel
{
+ /**
+ * @var bool
+ */
protected $isAnonymous;
+
+ /**
+ * @var bool
+ */
protected $isAnonymousVpn;
+
+ /**
+ * @var bool
+ */
protected $isHostingProvider;
+
+ /**
+ * @var bool
+ */
protected $isPublicProxy;
+
+ /**
+ * @var bool
+ */
+ protected $isResidentialProxy;
+
+ /**
+ * @var bool
+ */
protected $isTorExitNode;
+
+ /**
+ * @var string
+ */
protected $ipAddress;
+
+ /**
+ * @var string
+ */
protected $network;
/**
* @ignore
- *
- * @param mixed $raw
*/
- public function __construct($raw)
+ public function __construct(array $raw)
{
parent::__construct($raw);
@@ -48,6 +82,7 @@ class AnonymousIp extends AbstractModel
$this->isAnonymousVpn = $this->get('is_anonymous_vpn');
$this->isHostingProvider = $this->get('is_hosting_provider');
$this->isPublicProxy = $this->get('is_public_proxy');
+ $this->isResidentialProxy = $this->get('is_residential_proxy');
$this->isTorExitNode = $this->get('is_tor_exit_node');
$ipAddress = $this->get('ip_address');
$this->ipAddress = $ipAddress;
diff --git a/vendor/geoip2/geoip2/src/Model/Asn.php b/vendor/geoip2/geoip2/src/Model/Asn.php
index 09f746e..c28df26 100644
--- a/vendor/geoip2/geoip2/src/Model/Asn.php
+++ b/vendor/geoip2/geoip2/src/Model/Asn.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
use GeoIp2\Util;
@@ -20,17 +22,30 @@ use GeoIp2\Util;
*/
class Asn extends AbstractModel
{
+ /**
+ * @var int|null
+ */
protected $autonomousSystemNumber;
+
+ /**
+ * @var string|null
+ */
protected $autonomousSystemOrganization;
+
+ /**
+ * @var string
+ */
protected $ipAddress;
+
+ /**
+ * @var string
+ */
protected $network;
/**
* @ignore
- *
- * @param mixed $raw
*/
- public function __construct($raw)
+ public function __construct(array $raw)
{
parent::__construct($raw);
$this->autonomousSystemNumber = $this->get('autonomous_system_number');
diff --git a/vendor/geoip2/geoip2/src/Model/City.php b/vendor/geoip2/geoip2/src/Model/City.php
index bf8e352..701e9db 100644
--- a/vendor/geoip2/geoip2/src/Model/City.php
+++ b/vendor/geoip2/geoip2/src/Model/City.php
@@ -1,13 +1,15 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
/**
- * Model class for the data returned by GeoIP2 City web service and database.
+ * Model class for the data returned by City Plus web service and City
+ * database.
*
- * The only difference between the City and Insights model classes is which
- * fields in each record may be populated. See
- * https://dev.maxmind.com/geoip/geoip2/web-services for more details.
+ * See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more
+ * details.
*
* @property-read \GeoIp2\Record\City $city City data for the requested IP
* address.
@@ -31,28 +33,36 @@ class City extends Country
{
/**
* @ignore
+ *
+ * @var \GeoIp2\Record\City
*/
protected $city;
+
/**
* @ignore
+ *
+ * @var \GeoIp2\Record\Location
*/
protected $location;
+
/**
* @ignore
+ *
+ * @var \GeoIp2\Record\Postal
*/
protected $postal;
+
/**
* @ignore
+ *
+ * @var array<\GeoIp2\Record\Subdivision>
*/
protected $subdivisions = [];
/**
* @ignore
- *
- * @param mixed $raw
- * @param mixed $locales
*/
- public function __construct($raw, $locales = ['en'])
+ public function __construct(array $raw, array $locales = ['en'])
{
parent::__construct($raw, $locales);
@@ -63,29 +73,28 @@ class City extends Country
$this->createSubdivisions($raw, $locales);
}
- private function createSubdivisions($raw, $locales)
+ private function createSubdivisions(array $raw, array $locales): void
{
if (!isset($raw['subdivisions'])) {
return;
}
foreach ($raw['subdivisions'] as $sub) {
- array_push(
- $this->subdivisions,
+ $this->subdivisions[] =
new \GeoIp2\Record\Subdivision($sub, $locales)
- );
+ ;
}
}
/**
* @ignore
*
- * @param mixed $attr
+ * @return mixed
*/
- public function __get($attr)
+ public function __get(string $attr)
{
if ($attr === 'mostSpecificSubdivision') {
- return $this->$attr();
+ return $this->{$attr}();
}
return parent::__get($attr);
@@ -93,10 +102,8 @@ class City extends Country
/**
* @ignore
- *
- * @param mixed $attr
*/
- public function __isset($attr)
+ public function __isset(string $attr): bool
{
if ($attr === 'mostSpecificSubdivision') {
// We always return a mostSpecificSubdivision, even if it is the
@@ -107,7 +114,7 @@ class City extends Country
return parent::__isset($attr);
}
- private function mostSpecificSubdivision()
+ private function mostSpecificSubdivision(): \GeoIp2\Record\Subdivision
{
return empty($this->subdivisions) ?
new \GeoIp2\Record\Subdivision([], $this->locales) :
diff --git a/vendor/geoip2/geoip2/src/Model/ConnectionType.php b/vendor/geoip2/geoip2/src/Model/ConnectionType.php
index 013e6c3..e55fda1 100644
--- a/vendor/geoip2/geoip2/src/Model/ConnectionType.php
+++ b/vendor/geoip2/geoip2/src/Model/ConnectionType.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
use GeoIp2\Util;
@@ -18,16 +20,25 @@ use GeoIp2\Util;
*/
class ConnectionType extends AbstractModel
{
+ /**
+ * @var string|null
+ */
protected $connectionType;
+
+ /**
+ * @var string
+ */
protected $ipAddress;
+
+ /**
+ * @var string
+ */
protected $network;
/**
* @ignore
- *
- * @param mixed $raw
*/
- public function __construct($raw)
+ public function __construct(array $raw)
{
parent::__construct($raw);
diff --git a/vendor/geoip2/geoip2/src/Model/Country.php b/vendor/geoip2/geoip2/src/Model/Country.php
index 64d2650..67946b5 100644
--- a/vendor/geoip2/geoip2/src/Model/Country.php
+++ b/vendor/geoip2/geoip2/src/Model/Country.php
@@ -1,13 +1,13 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
/**
* Model class for the data returned by GeoIP2 Country web service and database.
*
- * The only difference between the City and Insights model classes is which
- * fields in each record may be populated. See
- * https://dev.maxmind.com/geoip/geoip2/web-services for more details.
+ * See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more details.
*
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
* requested IP address.
@@ -26,24 +26,49 @@ namespace GeoIp2\Model;
* the represented country differs from the country.
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
* requested IP address.
+ * @property-read array $raw The raw data from the web service.
*/
class Country extends AbstractModel
{
+ /**
+ * @var \GeoIp2\Record\Continent
+ */
protected $continent;
+
+ /**
+ * @var \GeoIp2\Record\Country
+ */
protected $country;
+
+ /**
+ * @var array<string>
+ */
protected $locales;
+
+ /**
+ * @var \GeoIp2\Record\MaxMind
+ */
protected $maxmind;
+
+ /**
+ * @var \GeoIp2\Record\Country
+ */
protected $registeredCountry;
+
+ /**
+ * @var \GeoIp2\Record\RepresentedCountry
+ */
protected $representedCountry;
+
+ /**
+ * @var \GeoIp2\Record\Traits
+ */
protected $traits;
/**
* @ignore
- *
- * @param mixed $raw
- * @param mixed $locales
*/
- public function __construct($raw, $locales = ['en'])
+ public function __construct(array $raw, array $locales = ['en'])
{
parent::__construct($raw);
diff --git a/vendor/geoip2/geoip2/src/Model/Domain.php b/vendor/geoip2/geoip2/src/Model/Domain.php
index 57982f7..df5e5cc 100644
--- a/vendor/geoip2/geoip2/src/Model/Domain.php
+++ b/vendor/geoip2/geoip2/src/Model/Domain.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
use GeoIp2\Util;
@@ -18,16 +20,25 @@ use GeoIp2\Util;
*/
class Domain extends AbstractModel
{
+ /**
+ * @var string|null
+ */
protected $domain;
+
+ /**
+ * @var string
+ */
protected $ipAddress;
+
+ /**
+ * @var string
+ */
protected $network;
/**
* @ignore
- *
- * @param mixed $raw
*/
- public function __construct($raw)
+ public function __construct(array $raw)
{
parent::__construct($raw);
diff --git a/vendor/geoip2/geoip2/src/Model/Enterprise.php b/vendor/geoip2/geoip2/src/Model/Enterprise.php
index 7f153fa..48becc6 100644
--- a/vendor/geoip2/geoip2/src/Model/Enterprise.php
+++ b/vendor/geoip2/geoip2/src/Model/Enterprise.php
@@ -1,13 +1,14 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
/**
* Model class for the data returned by GeoIP2 Enterprise database lookups.
*
- * The only difference between the City and Enterprise model classes is which
- * fields in each record may be populated. See
- * https://dev.maxmind.com/geoip/geoip2/web-services for more details.
+ * See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more
+ * details.
*/
class Enterprise extends City
{
diff --git a/vendor/geoip2/geoip2/src/Model/Insights.php b/vendor/geoip2/geoip2/src/Model/Insights.php
index df3a54c..320ef85 100644
--- a/vendor/geoip2/geoip2/src/Model/Insights.php
+++ b/vendor/geoip2/geoip2/src/Model/Insights.php
@@ -1,13 +1,14 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
/**
- * Model class for the data returned by GeoIP2 Precision: Insights web service.
+ * Model class for the data returned by GeoIP2 Insights web service.
*
- * The only difference between the City and Insights model classes is which
- * fields in each record may be populated. See
- * https://dev.maxmind.com/geoip/geoip2/web-services for more details.
+ * See https://dev.maxmind.com/geoip/docs/web-services?lang=en for
+ * more details.
*/
class Insights extends City
{
diff --git a/vendor/geoip2/geoip2/src/Model/Isp.php b/vendor/geoip2/geoip2/src/Model/Isp.php
index aa30f74..0f7a376 100644
--- a/vendor/geoip2/geoip2/src/Model/Isp.php
+++ b/vendor/geoip2/geoip2/src/Model/Isp.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace GeoIp2\Model;
use GeoIp2\Util;
@@ -14,6 +16,12 @@ use GeoIp2\Util;
* address.
* @property-read string|null $isp The name of the ISP associated with the IP
* address.
+ * @property-read string|null $mobileCountryCode The [mobile country code
+ * (MCC)](https://en.wikipedia.org/wiki/Mobile_country_code) associated with
+ * the IP address and ISP.
+ * @property-read string|null $mobileNetworkCode The [mobile network code
+ * (MNC)](https://en.wikipedia.org/wiki/Mobile_country_code) associated with
+ * the IP address and ISP.
* @property-read string|null $organization The name of the organization associated
* with the IP address.
* @property-read string $ipAddress The IP address that the data in the model is
@@ -24,25 +32,58 @@ use GeoIp2\Util;
*/
class Isp extends AbstractModel
{
+ /**
+ * @var int|null
+ */
protected $autonomousSystemNumber;
+
+ /**
+ * @var string|null
+ */
protected $autonomousSystemOrganization;
+
+ /**
+ * @var string|null
+ */
protected $isp;
+
+ /**
+ * @var string|null
+ */
+ protected $mobileCountryCode;
+
+ /**
+ * @var string|null
+ */
+ protected $mobileNetworkCode;
+
+ /**
+ * @var string|null
+ */
protected $organization;
+
+ /**
+ * @var string
+ */
protected $ipAddress;
+
+ /**
+ * @var string
+ */
protected $network;
/**
* @ignore
- *
- * @param mixed $raw
*/
- public function __construct($raw)
+ public function __construct(array $raw)
{
parent::__construct($raw);
$this->autonomousSystemNumber = $this->get('autonomous_system_number');
$this->autonomousSystemOrganization =
$this->get('autonomous_system_organization');
$this->isp = $this->get('isp');
+ $this->mobileCountryCode = $this->get('mobile_country_code');
+ $this->mobileNetworkCode = $this->get('mobile_network_code');
$this->organization = $this->get('organization');
$ipAddress = $this->get('ip_address');