GeoIP Detection - Version 4.0.1

Version Description

Hotfix - avoid fatal erros if another plugin also has the Maxmind library included

Download this release

Release Info

Developer benjamin4
Plugin Icon 128x128 GeoIP Detection
Version 4.0.1
Comparing to
See all releases

Code changes from version 4.0.0 to 4.0.1

Files changed (45) hide show
  1. composer.json +1 -1
  2. composer.lock +10 -10
  3. data-sources/abstract.php +2 -2
  4. data-sources/header.php +1 -1
  5. data-sources/hostinfo.php +2 -2
  6. data-sources/ipstack.php +2 -2
  7. data-sources/precision.php +1 -1
  8. geoip-detect.php +2 -2
  9. readme.txt +13 -6
  10. vendor/composer/autoload_classmap.php +1 -0
  11. vendor/composer/autoload_static.php +1 -0
  12. vendor/composer/installed.json +10 -10
  13. vendor/geoip2/geoip2/CHANGELOG.md +0 -8
  14. vendor/geoip2/geoip2/composer.json +4 -4
  15. vendor/geoip2/geoip2/src/Database/Reader.php +31 -17
  16. vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php +0 -2
  17. vendor/geoip2/geoip2/src/Exception/AuthenticationException.php +0 -2
  18. vendor/geoip2/geoip2/src/Exception/GeoIp2Exception.php +0 -2
  19. vendor/geoip2/geoip2/src/Exception/HttpException.php +3 -5
  20. vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php +4 -6
  21. vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php +0 -2
  22. vendor/geoip2/geoip2/src/Model/AbstractModel.php +13 -7
  23. vendor/geoip2/geoip2/src/Model/AnonymousIp.php +3 -7
  24. vendor/geoip2/geoip2/src/Model/Asn.php +3 -3
  25. vendor/geoip2/geoip2/src/Model/City.php +12 -7
  26. vendor/geoip2/geoip2/src/Model/ConnectionType.php +3 -3
  27. vendor/geoip2/geoip2/src/Model/Country.php +4 -3
  28. vendor/geoip2/geoip2/src/Model/Domain.php +3 -3
  29. vendor/geoip2/geoip2/src/Model/Enterprise.php +0 -2
  30. vendor/geoip2/geoip2/src/Model/Insights.php +0 -2
  31. vendor/geoip2/geoip2/src/Model/Isp.php +3 -3
  32. vendor/geoip2/geoip2/src/ProviderInterface.php +2 -4
  33. vendor/geoip2/geoip2/src/Record/AbstractPlaceRecord.php +13 -8
  34. vendor/geoip2/geoip2/src/Record/AbstractRecord.php +10 -8
  35. vendor/geoip2/geoip2/src/Record/City.php +0 -2
  36. vendor/geoip2/geoip2/src/Record/Continent.php +0 -2
  37. vendor/geoip2/geoip2/src/Record/Country.php +0 -2
  38. vendor/geoip2/geoip2/src/Record/Location.php +0 -2
  39. vendor/geoip2/geoip2/src/Record/MaxMind.php +0 -2
  40. vendor/geoip2/geoip2/src/Record/Postal.php +0 -2
  41. vendor/geoip2/geoip2/src/Record/RepresentedCountry.php +0 -2
  42. vendor/geoip2/geoip2/src/Record/Subdivision.php +0 -2
  43. vendor/geoip2/geoip2/src/Record/Traits.php +1 -7
  44. vendor/geoip2/geoip2/src/Util.php +4 -3
  45. vendor/geoip2/geoip2/src/WebService/Client.php +16 -12
composer.json CHANGED
@@ -14,7 +14,7 @@
14
  ],
15
  "require": {
16
  "php": ">=7.2.5",
17
- "geoip2/geoip2": "~2.0",
18
  "symfony/property-access": "^5.2",
19
  "symfony/http-foundation": "^5.2"
20
  },
14
  ],
15
  "require": {
16
  "php": ">=7.2.5",
17
+ "geoip2/geoip2": "2.10.0",
18
  "symfony/property-access": "^5.2",
19
  "symfony/http-foundation": "^5.2"
20
  },
composer.lock CHANGED
@@ -4,7 +4,7 @@
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
- "content-hash": "ee6848d44267b81644fd364617a57d54",
8
  "packages": [
9
  {
10
  "name": "composer/ca-bundle",
@@ -65,27 +65,27 @@
65
  },
66
  {
67
  "name": "geoip2/geoip2",
68
- "version": "v2.11.0",
69
  "source": {
70
  "type": "git",
71
  "url": "https://github.com/maxmind/GeoIP2-php.git",
72
- "reference": "d01be5894a5c1a3381c58c9b1795cd07f96c30f7"
73
  },
74
  "dist": {
75
  "type": "zip",
76
- "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/d01be5894a5c1a3381c58c9b1795cd07f96c30f7",
77
- "reference": "d01be5894a5c1a3381c58c9b1795cd07f96c30f7",
78
  "shasum": ""
79
  },
80
  "require": {
81
  "ext-json": "*",
82
- "maxmind-db/reader": "~1.8",
83
- "maxmind/web-service-common": "~0.8",
84
- "php": ">=7.2"
85
  },
86
  "require-dev": {
87
  "friendsofphp/php-cs-fixer": "2.*",
88
- "phpunit/phpunit": "^8.0 || ^9.0",
89
  "squizlabs/php_codesniffer": "3.*"
90
  },
91
  "type": "library",
@@ -114,7 +114,7 @@
114
  "geolocation",
115
  "maxmind"
116
  ],
117
- "time": "2020-10-01T18:48:34+00:00"
118
  },
119
  {
120
  "name": "maxmind-db/reader",
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
+ "content-hash": "0d123e07b2ea190b37b3dd96baaa0fc6",
8
  "packages": [
9
  {
10
  "name": "composer/ca-bundle",
65
  },
66
  {
67
  "name": "geoip2/geoip2",
68
+ "version": "v2.10.0",
69
  "source": {
70
  "type": "git",
71
  "url": "https://github.com/maxmind/GeoIP2-php.git",
72
+ "reference": "419557cd21d9fe039721a83490701a58c8ce784a"
73
  },
74
  "dist": {
75
  "type": "zip",
76
+ "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/419557cd21d9fe039721a83490701a58c8ce784a",
77
+ "reference": "419557cd21d9fe039721a83490701a58c8ce784a",
78
  "shasum": ""
79
  },
80
  "require": {
81
  "ext-json": "*",
82
+ "maxmind-db/reader": "~1.5",
83
+ "maxmind/web-service-common": "~0.6",
84
+ "php": ">=5.6"
85
  },
86
  "require-dev": {
87
  "friendsofphp/php-cs-fixer": "2.*",
88
+ "phpunit/phpunit": "5.*",
89
  "squizlabs/php_codesniffer": "3.*"
90
  },
91
  "type": "library",
114
  "geolocation",
115
  "maxmind"
116
  ],
117
+ "time": "2019-12-12T18:48:39+00:00"
118
  },
119
  {
120
  "name": "maxmind-db/reader",
data-sources/abstract.php CHANGED
@@ -98,11 +98,11 @@ abstract class AbstractReader implements \YellowTree\GeoipDetect\DataSources\Rea
98
  $this->options = $options;
99
  }
100
 
101
- public function city(string $ip): \GeoIp2\Model\City {
102
  throw new \BadMethodCallException('This datasource does not provide data for city()');
103
  }
104
 
105
- public function country(string $ip): \GeoIp2\Model\Country {
106
  throw new \BadMethodCallException('This datasource does not provide data for country()');
107
  }
108
 
98
  $this->options = $options;
99
  }
100
 
101
+ public function city($ip) {
102
  throw new \BadMethodCallException('This datasource does not provide data for city()');
103
  }
104
 
105
+ public function country($ip) {
106
  throw new \BadMethodCallException('This datasource does not provide data for country()');
107
  }
108
 
data-sources/header.php CHANGED
@@ -29,7 +29,7 @@ class HeaderReader extends \YellowTree\GeoipDetect\DataSources\AbstractReader {
29
  'cloudflare' => 'Cloudflare',
30
  );
31
 
32
- public function country($ip) : \GeoIp2\Model\Country {
33
 
34
  $r = array();
35
 
29
  'cloudflare' => 'Cloudflare',
30
  );
31
 
32
+ public function country($ip) {
33
 
34
  $r = array();
35
 
data-sources/hostinfo.php CHANGED
@@ -17,7 +17,7 @@ class Reader implements \YellowTree\GeoipDetect\DataSources\ReaderInterface {
17
  $this->options = $options + $default_options;
18
  }
19
 
20
- public function city($ip): \GeoIp2\Model\City {
21
  if (!geoip_detect_is_ip($ip, true))
22
  throw new \Exception('The Hostip.info-Database only contains IPv4 adresses.');
23
 
@@ -46,7 +46,7 @@ class Reader implements \YellowTree\GeoipDetect\DataSources\ReaderInterface {
46
  return $record;
47
  }
48
 
49
- public function country($ip): \GeoIp2\Model\Country {
50
  return $this->city($ip); // too much info shouldn't hurt ...
51
  }
52
 
17
  $this->options = $options + $default_options;
18
  }
19
 
20
+ public function city($ip) {
21
  if (!geoip_detect_is_ip($ip, true))
22
  throw new \Exception('The Hostip.info-Database only contains IPv4 adresses.');
23
 
46
  return $record;
47
  }
48
 
49
+ public function country($ip) {
50
  return $this->city($ip); // too much info shouldn't hurt ...
51
  }
52
 
data-sources/ipstack.php CHANGED
@@ -49,7 +49,7 @@ class Reader implements \YellowTree\GeoipDetect\DataSources\ReaderInterface {
49
  return $locales;
50
  }
51
 
52
- public function city($ip) : \GeoIp2\Model\City {
53
  $data = $this->api_call($ip);
54
 
55
  if (!$data)
@@ -128,7 +128,7 @@ class Reader implements \YellowTree\GeoipDetect\DataSources\ReaderInterface {
128
  return $record;
129
  }
130
 
131
- public function country($ip) : \GeoIp2\Model\Country {
132
  return $this->city($ip); // too much info shouldn't hurt ...
133
  }
134
 
49
  return $locales;
50
  }
51
 
52
+ public function city($ip) {
53
  $data = $this->api_call($ip);
54
 
55
  if (!$data)
128
  return $record;
129
  }
130
 
131
+ public function country($ip) {
132
  return $this->city($ip); // too much info shouldn't hurt ...
133
  }
134
 
data-sources/precision.php CHANGED
@@ -37,7 +37,7 @@ class PrecisionReader extends \GeoIp2\WebService\Client implements \YellowTree\G
37
  parent::__construct($userId, $licenseKey, array('en'), $options);
38
  }
39
 
40
- public function city($ip = 'me') : \GeoIp2\Model\City {
41
  $method = get_option('geoip-detect-precision_api_type', 'city');
42
 
43
  $ret = null;
37
  parent::__construct($userId, $licenseKey, array('en'), $options);
38
  }
39
 
40
+ public function city($ip = 'me') {
41
  $method = get_option('geoip-detect-precision_api_type', 'city');
42
 
43
  $ret = null;
geoip-detect.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.yellowtree.de
5
  Description: Retrieving Geo-Information using the Maxmind GeoIP (Lite) Database.
6
  Author: Yellow Tree (Benjamin Pick)
7
  Author URI: http://www.yellowtree.de
8
- Version: 4.0.0
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
  Text Domain: geoip-detect
@@ -16,7 +16,7 @@ Requires WP: 5.0
16
  Requires PHP: 7.2.5
17
  */
18
 
19
- define('GEOIP_DETECT_VERSION', '4.0.0');
20
 
21
  /*
22
  Copyright 2013-2021 Yellow Tree, Siegen, Germany
5
  Description: Retrieving Geo-Information using the Maxmind GeoIP (Lite) Database.
6
  Author: Yellow Tree (Benjamin Pick)
7
  Author URI: http://www.yellowtree.de
8
+ Version: 4.0.1
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
  Text Domain: geoip-detect
16
  Requires PHP: 7.2.5
17
  */
18
 
19
+ define('GEOIP_DETECT_VERSION', '4.0.1');
20
 
21
  /*
22
  Copyright 2013-2021 Yellow Tree, Siegen, Germany
readme.txt CHANGED
@@ -47,16 +47,16 @@ See [Documentation](https://github.com/yellowtree/geoip-detect/wiki) for more in
47
  * You could show the store nearest to your customer
48
  * You show or hide content specific to a geographic target group
49
  * Etc. ... You tell me! I'm rather curious what you'll do with this plugin!
50
- * Be careful to comply to the applicable laws. For example Regulation (EU) 2018/302 (going into effect 03 Dec 2018)...
51
  * If you need to get the user's timezone, it is more accurate to use JS solutions.
52
 
53
- **System Requirements**: You will need at least PHP 7.2. If you use the plugin WooCommerce, you'll need at least WooCommerce 3.9.0 .
54
 
55
  *GDPR: See [Is this plugin GDPR-compliant?](https://github.com/yellowtree/geoip-detect/wiki/FAQ#is-this-plugin-gdpr-compliant)*
56
 
57
  *This extension is "charity-ware". If you are happy with it, please [leave a tip](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BSYUZHS8FH3CL) for the benefit of [this charity](http://www.jmem-hainichen.de/homepage). (See [FAQ](https://github.com/yellowtree/geoip-detect/wiki/FAQ#what-you-mean-by-this-plugin-is-charity-ware) for more infos.)*
58
 
59
- *[Here are other ways to contribute to the development of this plugin.](https://github.com/yellowtree/geoip-detect/blob/master/CONTRIBUTING.md)
60
 
61
  *This product can provide GeoLite2 data created by MaxMind, available from http://www.maxmind.com.*
62
 
@@ -68,9 +68,9 @@ See [Documentation](https://github.com/yellowtree/geoip-detect/wiki) for more in
68
 
69
  === Troubleshooting ===
70
 
71
- Does `geoip_detect2_get_info_from_current_ip()` return the same country, regardless of where you are visiting the site from?
72
- Maybe your server has a reverse proxy configured. You can check this: Go to the options page and look for "reverse proxy". Are there 2 IPs listed there? If so, which one corresponds to your [public IP](https://www.whatismyip.com/)?
73
- Or maybe you are using a site cache plugin. Then enable the option `Disable caching a page that contains a shortcode or API call to geo-dependent functions.`
74
 
75
  [More Troubleshooting Hints](https://github.com/yellowtree/geoip-detect/wiki/Troubleshooting)
76
 
@@ -117,6 +117,10 @@ Or maybe you are using a site cache plugin. Then enable the option `Disable cach
117
 
118
  == Upgrade Notice ==
119
 
 
 
 
 
120
  = 4.0.0 =
121
 
122
  Improving Shortcodes (and Shortcodes for AJAX!)
@@ -159,6 +163,9 @@ If you use Maxmind "Automatic download" then you need to upgrade to this plugin
159
 
160
  == Changelog ==
161
 
 
 
 
162
  = 4.0.0 =
163
  This version has many changes regarding the Shortcodes API. It is a major version because it increases some system requirements (see below).
164
 
47
  * You could show the store nearest to your customer
48
  * You show or hide content specific to a geographic target group
49
  * Etc. ... You tell me! I'm rather curious what you'll do with this plugin!
50
+ * Be careful to comply to the applicable laws. For example Regulation (EU) 2018/302 ...
51
  * If you need to get the user's timezone, it is more accurate to use JS solutions.
52
 
53
+ **System Requirements**: You will need at least PHP 7.2.5 If you use the plugin WooCommerce, you'll need at least WooCommerce 3.9.0 .
54
 
55
  *GDPR: See [Is this plugin GDPR-compliant?](https://github.com/yellowtree/geoip-detect/wiki/FAQ#is-this-plugin-gdpr-compliant)*
56
 
57
  *This extension is "charity-ware". If you are happy with it, please [leave a tip](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BSYUZHS8FH3CL) for the benefit of [this charity](http://www.jmem-hainichen.de/homepage). (See [FAQ](https://github.com/yellowtree/geoip-detect/wiki/FAQ#what-you-mean-by-this-plugin-is-charity-ware) for more infos.)*
58
 
59
+ *[Here are other ways to contribute to the development of this plugin.](https://github.com/yellowtree/geoip-detect/blob/master/CONTRIBUTING.md)*
60
 
61
  *This product can provide GeoLite2 data created by MaxMind, available from http://www.maxmind.com.*
62
 
68
 
69
  === Troubleshooting ===
70
 
71
+ * Does `geoip_detect2_get_info_from_current_ip()` return the same country, regardless of where you are visiting the site from?
72
+ * Maybe your server has a reverse proxy configured. You can check this: Go to the options page and look for "reverse proxy". Are there 2 IPs listed there? If so, which one corresponds to your [public IP](https://www.whatismyip.com/)?
73
+ * Or maybe you are using a site cache plugin. Then enable the option `Disable caching a page that contains a shortcode or API call to geo-dependent functions.`
74
 
75
  [More Troubleshooting Hints](https://github.com/yellowtree/geoip-detect/wiki/Troubleshooting)
76
 
117
 
118
  == Upgrade Notice ==
119
 
120
+ = 4.0.1 =
121
+
122
+ Hotfix - avoid fatal erros if another plugin also has the Maxmind library included
123
+
124
  = 4.0.0 =
125
 
126
  Improving Shortcodes (and Shortcodes for AJAX!)
163
 
164
  == Changelog ==
165
 
166
+ = 4.0.1 =
167
+ * Revert Maxmind library to 2.10.0 for now as the most current version seems to be incompatible with Wordfence and other plugins using the older version of the Maxmind library
168
+
169
  = 4.0.0 =
170
  This version has many changes regarding the Shortcodes API. It is a major version because it increases some system requirements (see below).
171
 
vendor/composer/autoload_classmap.php CHANGED
@@ -160,6 +160,7 @@ return array(
160
  'Symfony\\Component\\PropertyAccess\\PropertyPathInterface' => $vendorDir . '/symfony/property-access/PropertyPathInterface.php',
161
  'Symfony\\Component\\PropertyAccess\\PropertyPathIterator' => $vendorDir . '/symfony/property-access/PropertyPathIterator.php',
162
  'Symfony\\Component\\PropertyAccess\\PropertyPathIteratorInterface' => $vendorDir . '/symfony/property-access/PropertyPathIteratorInterface.php',
 
163
  'Symfony\\Component\\PropertyInfo\\DependencyInjection\\PropertyInfoConstructorPass' => $vendorDir . '/symfony/property-info/DependencyInjection/PropertyInfoConstructorPass.php',
164
  'Symfony\\Component\\PropertyInfo\\DependencyInjection\\PropertyInfoPass' => $vendorDir . '/symfony/property-info/DependencyInjection/PropertyInfoPass.php',
165
  'Symfony\\Component\\PropertyInfo\\Extractor\\ConstructorArgumentTypeExtractorInterface' => $vendorDir . '/symfony/property-info/Extractor/ConstructorArgumentTypeExtractorInterface.php',
160
  'Symfony\\Component\\PropertyAccess\\PropertyPathInterface' => $vendorDir . '/symfony/property-access/PropertyPathInterface.php',
161
  'Symfony\\Component\\PropertyAccess\\PropertyPathIterator' => $vendorDir . '/symfony/property-access/PropertyPathIterator.php',
162
  'Symfony\\Component\\PropertyAccess\\PropertyPathIteratorInterface' => $vendorDir . '/symfony/property-access/PropertyPathIteratorInterface.php',
163
+ 'Symfony\\Component\\PropertyAccess\\StringUtil' => $vendorDir . '/symfony/property-access/StringUtil.php',
164
  'Symfony\\Component\\PropertyInfo\\DependencyInjection\\PropertyInfoConstructorPass' => $vendorDir . '/symfony/property-info/DependencyInjection/PropertyInfoConstructorPass.php',
165
  'Symfony\\Component\\PropertyInfo\\DependencyInjection\\PropertyInfoPass' => $vendorDir . '/symfony/property-info/DependencyInjection/PropertyInfoPass.php',
166
  'Symfony\\Component\\PropertyInfo\\Extractor\\ConstructorArgumentTypeExtractorInterface' => $vendorDir . '/symfony/property-info/Extractor/ConstructorArgumentTypeExtractorInterface.php',
vendor/composer/autoload_static.php CHANGED
@@ -259,6 +259,7 @@ class ComposerStaticInit18fc54d84025f2e5d2b2ac2dd487f107
259
  'Symfony\\Component\\PropertyAccess\\PropertyPathInterface' => __DIR__ . '/..' . '/symfony/property-access/PropertyPathInterface.php',
260
  'Symfony\\Component\\PropertyAccess\\PropertyPathIterator' => __DIR__ . '/..' . '/symfony/property-access/PropertyPathIterator.php',
261
  'Symfony\\Component\\PropertyAccess\\PropertyPathIteratorInterface' => __DIR__ . '/..' . '/symfony/property-access/PropertyPathIteratorInterface.php',
 
262
  'Symfony\\Component\\PropertyInfo\\DependencyInjection\\PropertyInfoConstructorPass' => __DIR__ . '/..' . '/symfony/property-info/DependencyInjection/PropertyInfoConstructorPass.php',
263
  'Symfony\\Component\\PropertyInfo\\DependencyInjection\\PropertyInfoPass' => __DIR__ . '/..' . '/symfony/property-info/DependencyInjection/PropertyInfoPass.php',
264
  'Symfony\\Component\\PropertyInfo\\Extractor\\ConstructorArgumentTypeExtractorInterface' => __DIR__ . '/..' . '/symfony/property-info/Extractor/ConstructorArgumentTypeExtractorInterface.php',
259
  'Symfony\\Component\\PropertyAccess\\PropertyPathInterface' => __DIR__ . '/..' . '/symfony/property-access/PropertyPathInterface.php',
260
  'Symfony\\Component\\PropertyAccess\\PropertyPathIterator' => __DIR__ . '/..' . '/symfony/property-access/PropertyPathIterator.php',
261
  'Symfony\\Component\\PropertyAccess\\PropertyPathIteratorInterface' => __DIR__ . '/..' . '/symfony/property-access/PropertyPathIteratorInterface.php',
262
+ 'Symfony\\Component\\PropertyAccess\\StringUtil' => __DIR__ . '/..' . '/symfony/property-access/StringUtil.php',
263
  'Symfony\\Component\\PropertyInfo\\DependencyInjection\\PropertyInfoConstructorPass' => __DIR__ . '/..' . '/symfony/property-info/DependencyInjection/PropertyInfoConstructorPass.php',
264
  'Symfony\\Component\\PropertyInfo\\DependencyInjection\\PropertyInfoPass' => __DIR__ . '/..' . '/symfony/property-info/DependencyInjection/PropertyInfoPass.php',
265
  'Symfony\\Component\\PropertyInfo\\Extractor\\ConstructorArgumentTypeExtractorInterface' => __DIR__ . '/..' . '/symfony/property-info/Extractor/ConstructorArgumentTypeExtractorInterface.php',
vendor/composer/installed.json CHANGED
@@ -60,31 +60,31 @@
60
  },
61
  {
62
  "name": "geoip2/geoip2",
63
- "version": "v2.11.0",
64
- "version_normalized": "2.11.0.0",
65
  "source": {
66
  "type": "git",
67
  "url": "https://github.com/maxmind/GeoIP2-php.git",
68
- "reference": "d01be5894a5c1a3381c58c9b1795cd07f96c30f7"
69
  },
70
  "dist": {
71
  "type": "zip",
72
- "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/d01be5894a5c1a3381c58c9b1795cd07f96c30f7",
73
- "reference": "d01be5894a5c1a3381c58c9b1795cd07f96c30f7",
74
  "shasum": ""
75
  },
76
  "require": {
77
  "ext-json": "*",
78
- "maxmind-db/reader": "~1.8",
79
- "maxmind/web-service-common": "~0.8",
80
- "php": ">=7.2"
81
  },
82
  "require-dev": {
83
  "friendsofphp/php-cs-fixer": "2.*",
84
- "phpunit/phpunit": "^8.0 || ^9.0",
85
  "squizlabs/php_codesniffer": "3.*"
86
  },
87
- "time": "2020-10-01T18:48:34+00:00",
88
  "type": "library",
89
  "installation-source": "dist",
90
  "autoload": {
60
  },
61
  {
62
  "name": "geoip2/geoip2",
63
+ "version": "v2.10.0",
64
+ "version_normalized": "2.10.0.0",
65
  "source": {
66
  "type": "git",
67
  "url": "https://github.com/maxmind/GeoIP2-php.git",
68
+ "reference": "419557cd21d9fe039721a83490701a58c8ce784a"
69
  },
70
  "dist": {
71
  "type": "zip",
72
+ "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/419557cd21d9fe039721a83490701a58c8ce784a",
73
+ "reference": "419557cd21d9fe039721a83490701a58c8ce784a",
74
  "shasum": ""
75
  },
76
  "require": {
77
  "ext-json": "*",
78
+ "maxmind-db/reader": "~1.5",
79
+ "maxmind/web-service-common": "~0.6",
80
+ "php": ">=5.6"
81
  },
82
  "require-dev": {
83
  "friendsofphp/php-cs-fixer": "2.*",
84
+ "phpunit/phpunit": "5.*",
85
  "squizlabs/php_codesniffer": "3.*"
86
  },
87
+ "time": "2019-12-12T18:48:39+00:00",
88
  "type": "library",
89
  "installation-source": "dist",
90
  "autoload": {
vendor/geoip2/geoip2/CHANGELOG.md CHANGED
@@ -1,14 +1,6 @@
1
  CHANGELOG
2
  =========
3
 
4
- 2.11.0 (2020-10-01)
5
- -------------------
6
-
7
- * IMPORTANT: PHP 7.2 or greater is now required.
8
- * Added the `isResidentialProxy` property to `GeoIp2\Model\AnonymousIP` and
9
- `GeoIp2\Record\Traits`.
10
- * Additional type hints have been added.
11
-
12
  2.10.0 (2019-12-12)
13
  -------------------
14
 
1
  CHANGELOG
2
  =========
3
 
 
 
 
 
 
 
 
 
4
  2.10.0 (2019-12-12)
5
  -------------------
6
 
vendor/geoip2/geoip2/composer.json CHANGED
@@ -13,14 +13,14 @@
13
  }
14
  ],
15
  "require": {
16
- "maxmind-db/reader": "~1.8",
17
- "maxmind/web-service-common": "~0.8",
18
- "php": ">=7.2",
19
  "ext-json": "*"
20
  },
21
  "require-dev": {
22
  "friendsofphp/php-cs-fixer": "2.*",
23
- "phpunit/phpunit": "^8.0 || ^9.0",
24
  "squizlabs/php_codesniffer": "3.*"
25
  },
26
  "autoload": {
13
  }
14
  ],
15
  "require": {
16
+ "maxmind-db/reader": "~1.5",
17
+ "maxmind/web-service-common": "~0.6",
18
+ "php": ">=5.6",
19
  "ext-json": "*"
20
  },
21
  "require-dev": {
22
  "friendsofphp/php-cs-fixer": "2.*",
23
+ "phpunit/phpunit": "5.*",
24
  "squizlabs/php_codesniffer": "3.*"
25
  },
26
  "autoload": {
vendor/geoip2/geoip2/src/Database/Reader.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Database;
6
 
7
  use GeoIp2\Exception\AddressNotFoundException;
@@ -50,8 +48,8 @@ class Reader implements ProviderInterface
50
  * is corrupt or invalid
51
  */
52
  public function __construct(
53
- string $filename,
54
- array $locales = ['en']
55
  ) {
56
  $this->dbReader = new DbReader($filename);
57
  $this->dbType = $this->dbReader->metadata()->databaseType;
@@ -67,8 +65,10 @@ class Reader implements ProviderInterface
67
  * not in the database
68
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
69
  * is corrupt or invalid
 
 
70
  */
71
- public function city(string $ipAddress): \GeoIp2\Model\City
72
  {
73
  return $this->modelFor('City', 'City', $ipAddress);
74
  }
@@ -82,8 +82,10 @@ class Reader implements ProviderInterface
82
  * not in the database
83
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
84
  * is corrupt or invalid
 
 
85
  */
86
- public function country(string $ipAddress): \GeoIp2\Model\Country
87
  {
88
  return $this->modelFor('Country', 'Country', $ipAddress);
89
  }
@@ -97,8 +99,10 @@ class Reader implements ProviderInterface
97
  * not in the database
98
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
99
  * is corrupt or invalid
 
 
100
  */
101
- public function anonymousIp(string $ipAddress): \GeoIp2\Model\AnonymousIp
102
  {
103
  return $this->flatModelFor(
104
  'AnonymousIp',
@@ -116,8 +120,10 @@ class Reader implements ProviderInterface
116
  * not in the database
117
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
118
  * is corrupt or invalid
 
 
119
  */
120
- public function asn(string $ipAddress): \GeoIp2\Model\Asn
121
  {
122
  return $this->flatModelFor(
123
  'Asn',
@@ -135,8 +141,10 @@ class Reader implements ProviderInterface
135
  * not in the database
136
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
137
  * is corrupt or invalid
 
 
138
  */
139
- public function connectionType(string $ipAddress): \GeoIp2\Model\ConnectionType
140
  {
141
  return $this->flatModelFor(
142
  'ConnectionType',
@@ -154,8 +162,10 @@ class Reader implements ProviderInterface
154
  * not in the database
155
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
156
  * is corrupt or invalid
 
 
157
  */
158
- public function domain(string $ipAddress): \GeoIp2\Model\Domain
159
  {
160
  return $this->flatModelFor(
161
  'Domain',
@@ -173,8 +183,10 @@ class Reader implements ProviderInterface
173
  * not in the database
174
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
175
  * is corrupt or invalid
 
 
176
  */
177
- public function enterprise(string $ipAddress): \GeoIp2\Model\Enterprise
178
  {
179
  return $this->modelFor('Enterprise', 'Enterprise', $ipAddress);
180
  }
@@ -188,8 +200,10 @@ class Reader implements ProviderInterface
188
  * not in the database
189
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
190
  * is corrupt or invalid
 
 
191
  */
192
- public function isp(string $ipAddress): \GeoIp2\Model\Isp
193
  {
194
  return $this->flatModelFor(
195
  'Isp',
@@ -198,7 +212,7 @@ class Reader implements ProviderInterface
198
  );
199
  }
200
 
201
- private function modelFor(string $class, string $type, string $ipAddress)
202
  {
203
  list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress);
204
 
@@ -210,7 +224,7 @@ class Reader implements ProviderInterface
210
  return new $class($record, $this->locales);
211
  }
212
 
213
- private function flatModelFor(string $class, string $type, string $ipAddress)
214
  {
215
  list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress);
216
 
@@ -221,7 +235,7 @@ class Reader implements ProviderInterface
221
  return new $class($record);
222
  }
223
 
224
- private function getRecord(string $class, string $type, string $ipAddress): array
225
  {
226
  if (strpos($this->dbType, $type) === false) {
227
  $method = lcfirst($class);
@@ -258,7 +272,7 @@ class Reader implements ProviderInterface
258
  *
259
  * @return \MaxMind\Db\Reader\Metadata object for the database
260
  */
261
- public function metadata(): \MaxMind\Db\Reader\Metadata
262
  {
263
  return $this->dbReader->metadata();
264
  }
@@ -266,7 +280,7 @@ class Reader implements ProviderInterface
266
  /**
267
  * Closes the GeoIP2 database and returns the resources to the system.
268
  */
269
- public function close(): void
270
  {
271
  $this->dbReader->close();
272
  }
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Database;
4
 
5
  use GeoIp2\Exception\AddressNotFoundException;
48
  * is corrupt or invalid
49
  */
50
  public function __construct(
51
+ $filename,
52
+ $locales = ['en']
53
  ) {
54
  $this->dbReader = new DbReader($filename);
55
  $this->dbType = $this->dbReader->metadata()->databaseType;
65
  * not in the database
66
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
67
  * is corrupt or invalid
68
+ *
69
+ * @return \GeoIp2\Model\City
70
  */
71
+ public function city($ipAddress)
72
  {
73
  return $this->modelFor('City', 'City', $ipAddress);
74
  }
82
  * not in the database
83
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
84
  * is corrupt or invalid
85
+ *
86
+ * @return \GeoIp2\Model\Country
87
  */
88
+ public function country($ipAddress)
89
  {
90
  return $this->modelFor('Country', 'Country', $ipAddress);
91
  }
99
  * not in the database
100
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
101
  * is corrupt or invalid
102
+ *
103
+ * @return \GeoIp2\Model\AnonymousIp
104
  */
105
+ public function anonymousIp($ipAddress)
106
  {
107
  return $this->flatModelFor(
108
  'AnonymousIp',
120
  * not in the database
121
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
122
  * is corrupt or invalid
123
+ *
124
+ * @return \GeoIp2\Model\Asn
125
  */
126
+ public function asn($ipAddress)
127
  {
128
  return $this->flatModelFor(
129
  'Asn',
141
  * not in the database
142
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
143
  * is corrupt or invalid
144
+ *
145
+ * @return \GeoIp2\Model\ConnectionType
146
  */
147
+ public function connectionType($ipAddress)
148
  {
149
  return $this->flatModelFor(
150
  'ConnectionType',
162
  * not in the database
163
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
164
  * is corrupt or invalid
165
+ *
166
+ * @return \GeoIp2\Model\Domain
167
  */
168
+ public function domain($ipAddress)
169
  {
170
  return $this->flatModelFor(
171
  'Domain',
183
  * not in the database
184
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
185
  * is corrupt or invalid
186
+ *
187
+ * @return \GeoIp2\Model\Enterprise
188
  */
189
+ public function enterprise($ipAddress)
190
  {
191
  return $this->modelFor('Enterprise', 'Enterprise', $ipAddress);
192
  }
200
  * not in the database
201
  * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
202
  * is corrupt or invalid
203
+ *
204
+ * @return \GeoIp2\Model\Isp
205
  */
206
+ public function isp($ipAddress)
207
  {
208
  return $this->flatModelFor(
209
  'Isp',
212
  );
213
  }
214
 
215
+ private function modelFor($class, $type, $ipAddress)
216
  {
217
  list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress);
218
 
224
  return new $class($record, $this->locales);
225
  }
226
 
227
+ private function flatModelFor($class, $type, $ipAddress)
228
  {
229
  list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress);
230
 
235
  return new $class($record);
236
  }
237
 
238
+ private function getRecord($class, $type, $ipAddress)
239
  {
240
  if (strpos($this->dbType, $type) === false) {
241
  $method = lcfirst($class);
272
  *
273
  * @return \MaxMind\Db\Reader\Metadata object for the database
274
  */
275
+ public function metadata()
276
  {
277
  return $this->dbReader->metadata();
278
  }
280
  /**
281
  * Closes the GeoIP2 database and returns the resources to the system.
282
  */
283
+ public function close()
284
  {
285
  $this->dbReader->close();
286
  }
vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Exception;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Exception;
4
 
5
  /**
vendor/geoip2/geoip2/src/Exception/AuthenticationException.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Exception;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Exception;
4
 
5
  /**
vendor/geoip2/geoip2/src/Exception/GeoIp2Exception.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Exception;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Exception;
4
 
5
  /**
vendor/geoip2/geoip2/src/Exception/HttpException.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Exception;
6
 
7
  /**
@@ -15,9 +13,9 @@ class HttpException extends GeoIp2Exception
15
  public $uri;
16
 
17
  public function __construct(
18
- string $message,
19
- int $httpStatus,
20
- string $uri,
21
  \Exception $previous = null
22
  ) {
23
  $this->uri = $uri;
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Exception;
4
 
5
  /**
13
  public $uri;
14
 
15
  public function __construct(
16
+ $message,
17
+ $httpStatus,
18
+ $uri,
19
  \Exception $previous = null
20
  ) {
21
  $this->uri = $uri;
vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Exception;
6
 
7
  /**
@@ -16,10 +14,10 @@ class InvalidRequestException extends HttpException
16
  public $error;
17
 
18
  public function __construct(
19
- string $message,
20
- string $error,
21
- int $httpStatus,
22
- string $uri,
23
  \Exception $previous = null
24
  ) {
25
  $this->error = $error;
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Exception;
4
 
5
  /**
14
  public $error;
15
 
16
  public function __construct(
17
+ $message,
18
+ $error,
19
+ $httpStatus,
20
+ $uri,
21
  \Exception $previous = null
22
  ) {
23
  $this->error = $error;
vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Exception;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Exception;
4
 
5
  /**
vendor/geoip2/geoip2/src/Model/AbstractModel.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  /**
@@ -13,16 +11,20 @@ abstract class AbstractModel implements \JsonSerializable
13
 
14
  /**
15
  * @ignore
 
 
16
  */
17
- public function __construct(array $raw)
18
  {
19
  $this->raw = $raw;
20
  }
21
 
22
  /**
23
  * @ignore
 
 
24
  */
25
- protected function get(string $field)
26
  {
27
  if (isset($this->raw[$field])) {
28
  return $this->raw[$field];
@@ -36,8 +38,10 @@ abstract class AbstractModel implements \JsonSerializable
36
 
37
  /**
38
  * @ignore
 
 
39
  */
40
- public function __get(string $attr)
41
  {
42
  if ($attr !== 'instance' && property_exists($this, $attr)) {
43
  return $this->$attr;
@@ -48,13 +52,15 @@ abstract class AbstractModel implements \JsonSerializable
48
 
49
  /**
50
  * @ignore
 
 
51
  */
52
- public function __isset(string $attr): bool
53
  {
54
  return $attr !== 'instance' && isset($this->$attr);
55
  }
56
 
57
- public function jsonSerialize(): array
58
  {
59
  return $this->raw;
60
  }
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  /**
11
 
12
  /**
13
  * @ignore
14
+ *
15
+ * @param mixed $raw
16
  */
17
+ public function __construct($raw)
18
  {
19
  $this->raw = $raw;
20
  }
21
 
22
  /**
23
  * @ignore
24
+ *
25
+ * @param mixed $field
26
  */
27
+ protected function get($field)
28
  {
29
  if (isset($this->raw[$field])) {
30
  return $this->raw[$field];
38
 
39
  /**
40
  * @ignore
41
+ *
42
+ * @param mixed $attr
43
  */
44
+ public function __get($attr)
45
  {
46
  if ($attr !== 'instance' && property_exists($this, $attr)) {
47
  return $this->$attr;
52
 
53
  /**
54
  * @ignore
55
+ *
56
+ * @param mixed $attr
57
  */
58
+ public function __isset($attr)
59
  {
60
  return $attr !== 'instance' && isset($this->$attr);
61
  }
62
 
63
+ public function jsonSerialize()
64
  {
65
  return $this->raw;
66
  }
vendor/geoip2/geoip2/src/Model/AnonymousIp.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  use GeoIp2\Util;
@@ -19,8 +17,6 @@ use GeoIp2\Util;
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
@@ -35,15 +31,16 @@ class AnonymousIp extends AbstractModel
35
  protected $isAnonymousVpn;
36
  protected $isHostingProvider;
37
  protected $isPublicProxy;
38
- protected $isResidentialProxy;
39
  protected $isTorExitNode;
40
  protected $ipAddress;
41
  protected $network;
42
 
43
  /**
44
  * @ignore
 
 
45
  */
46
- public function __construct(array $raw)
47
  {
48
  parent::__construct($raw);
49
 
@@ -51,7 +48,6 @@ class AnonymousIp extends AbstractModel
51
  $this->isAnonymousVpn = $this->get('is_anonymous_vpn');
52
  $this->isHostingProvider = $this->get('is_hosting_provider');
53
  $this->isPublicProxy = $this->get('is_public_proxy');
54
- $this->isResidentialProxy = $this->get('is_residential_proxy');
55
  $this->isTorExitNode = $this->get('is_tor_exit_node');
56
  $ipAddress = $this->get('ip_address');
57
  $this->ipAddress = $ipAddress;
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  use GeoIp2\Util;
17
  * to a hosting or VPN provider (see description of isAnonymousVpn property).
18
  * @property-read bool $isPublicProxy This is true if the IP address belongs to
19
  * a public proxy.
 
 
20
  * @property-read bool $isTorExitNode This is true if the IP address is a Tor
21
  * exit node.
22
  * @property-read string $ipAddress The IP address that the data in the model is
31
  protected $isAnonymousVpn;
32
  protected $isHostingProvider;
33
  protected $isPublicProxy;
 
34
  protected $isTorExitNode;
35
  protected $ipAddress;
36
  protected $network;
37
 
38
  /**
39
  * @ignore
40
+ *
41
+ * @param mixed $raw
42
  */
43
+ public function __construct($raw)
44
  {
45
  parent::__construct($raw);
46
 
48
  $this->isAnonymousVpn = $this->get('is_anonymous_vpn');
49
  $this->isHostingProvider = $this->get('is_hosting_provider');
50
  $this->isPublicProxy = $this->get('is_public_proxy');
 
51
  $this->isTorExitNode = $this->get('is_tor_exit_node');
52
  $ipAddress = $this->get('ip_address');
53
  $this->ipAddress = $ipAddress;
vendor/geoip2/geoip2/src/Model/Asn.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  use GeoIp2\Util;
@@ -29,8 +27,10 @@ class Asn extends AbstractModel
29
 
30
  /**
31
  * @ignore
 
 
32
  */
33
- public function __construct(array $raw)
34
  {
35
  parent::__construct($raw);
36
  $this->autonomousSystemNumber = $this->get('autonomous_system_number');
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  use GeoIp2\Util;
27
 
28
  /**
29
  * @ignore
30
+ *
31
+ * @param mixed $raw
32
  */
33
+ public function __construct($raw)
34
  {
35
  parent::__construct($raw);
36
  $this->autonomousSystemNumber = $this->get('autonomous_system_number');
vendor/geoip2/geoip2/src/Model/City.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  /**
@@ -50,8 +48,11 @@ class City extends Country
50
 
51
  /**
52
  * @ignore
 
 
 
53
  */
54
- public function __construct(array $raw, array $locales = ['en'])
55
  {
56
  parent::__construct($raw, $locales);
57
 
@@ -62,7 +63,7 @@ class City extends Country
62
  $this->createSubdivisions($raw, $locales);
63
  }
64
 
65
- private function createSubdivisions(array $raw, array $locales): void
66
  {
67
  if (!isset($raw['subdivisions'])) {
68
  return;
@@ -78,8 +79,10 @@ class City extends Country
78
 
79
  /**
80
  * @ignore
 
 
81
  */
82
- public function __get(string $attr)
83
  {
84
  if ($attr === 'mostSpecificSubdivision') {
85
  return $this->$attr();
@@ -90,8 +93,10 @@ class City extends Country
90
 
91
  /**
92
  * @ignore
 
 
93
  */
94
- public function __isset(string $attr): bool
95
  {
96
  if ($attr === 'mostSpecificSubdivision') {
97
  // We always return a mostSpecificSubdivision, even if it is the
@@ -102,7 +107,7 @@ class City extends Country
102
  return parent::__isset($attr);
103
  }
104
 
105
- private function mostSpecificSubdivision(): \GeoIp2\Record\Subdivision
106
  {
107
  return empty($this->subdivisions) ?
108
  new \GeoIp2\Record\Subdivision([], $this->locales) :
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  /**
48
 
49
  /**
50
  * @ignore
51
+ *
52
+ * @param mixed $raw
53
+ * @param mixed $locales
54
  */
55
+ public function __construct($raw, $locales = ['en'])
56
  {
57
  parent::__construct($raw, $locales);
58
 
63
  $this->createSubdivisions($raw, $locales);
64
  }
65
 
66
+ private function createSubdivisions($raw, $locales)
67
  {
68
  if (!isset($raw['subdivisions'])) {
69
  return;
79
 
80
  /**
81
  * @ignore
82
+ *
83
+ * @param mixed $attr
84
  */
85
+ public function __get($attr)
86
  {
87
  if ($attr === 'mostSpecificSubdivision') {
88
  return $this->$attr();
93
 
94
  /**
95
  * @ignore
96
+ *
97
+ * @param mixed $attr
98
  */
99
+ public function __isset($attr)
100
  {
101
  if ($attr === 'mostSpecificSubdivision') {
102
  // We always return a mostSpecificSubdivision, even if it is the
107
  return parent::__isset($attr);
108
  }
109
 
110
+ private function mostSpecificSubdivision()
111
  {
112
  return empty($this->subdivisions) ?
113
  new \GeoIp2\Record\Subdivision([], $this->locales) :
vendor/geoip2/geoip2/src/Model/ConnectionType.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  use GeoIp2\Util;
@@ -26,8 +24,10 @@ class ConnectionType extends AbstractModel
26
 
27
  /**
28
  * @ignore
 
 
29
  */
30
- public function __construct(array $raw)
31
  {
32
  parent::__construct($raw);
33
 
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  use GeoIp2\Util;
24
 
25
  /**
26
  * @ignore
27
+ *
28
+ * @param mixed $raw
29
  */
30
+ public function __construct($raw)
31
  {
32
  parent::__construct($raw);
33
 
vendor/geoip2/geoip2/src/Model/Country.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  /**
@@ -41,8 +39,11 @@ class Country extends AbstractModel
41
 
42
  /**
43
  * @ignore
 
 
 
44
  */
45
- public function __construct(array $raw, array $locales = ['en'])
46
  {
47
  parent::__construct($raw);
48
 
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  /**
39
 
40
  /**
41
  * @ignore
42
+ *
43
+ * @param mixed $raw
44
+ * @param mixed $locales
45
  */
46
+ public function __construct($raw, $locales = ['en'])
47
  {
48
  parent::__construct($raw);
49
 
vendor/geoip2/geoip2/src/Model/Domain.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  use GeoIp2\Util;
@@ -26,8 +24,10 @@ class Domain extends AbstractModel
26
 
27
  /**
28
  * @ignore
 
 
29
  */
30
- public function __construct(array $raw)
31
  {
32
  parent::__construct($raw);
33
 
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  use GeoIp2\Util;
24
 
25
  /**
26
  * @ignore
27
+ *
28
+ * @param mixed $raw
29
  */
30
+ public function __construct($raw)
31
  {
32
  parent::__construct($raw);
33
 
vendor/geoip2/geoip2/src/Model/Enterprise.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  /**
vendor/geoip2/geoip2/src/Model/Insights.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  /**
vendor/geoip2/geoip2/src/Model/Isp.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Model;
6
 
7
  use GeoIp2\Util;
@@ -35,8 +33,10 @@ class Isp extends AbstractModel
35
 
36
  /**
37
  * @ignore
 
 
38
  */
39
- public function __construct(array $raw)
40
  {
41
  parent::__construct($raw);
42
  $this->autonomousSystemNumber = $this->get('autonomous_system_number');
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Model;
4
 
5
  use GeoIp2\Util;
33
 
34
  /**
35
  * @ignore
36
+ *
37
+ * @param mixed $raw
38
  */
39
+ public function __construct($raw)
40
  {
41
  parent::__construct($raw);
42
  $this->autonomousSystemNumber = $this->get('autonomous_system_number');
vendor/geoip2/geoip2/src/ProviderInterface.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2;
6
 
7
  interface ProviderInterface
@@ -11,12 +9,12 @@ interface ProviderInterface
11
  *
12
  * @return \GeoIp2\Model\Country a Country model for the requested IP address
13
  */
14
- public function country(string $ipAddress): \GeoIp2\Model\Country;
15
 
16
  /**
17
  * @param string $ipAddress an IPv4 or IPv6 address to lookup
18
  *
19
  * @return \GeoIp2\Model\City a City model for the requested IP address
20
  */
21
- public function city(string $ipAddress): \GeoIp2\Model\City;
22
  }
1
  <?php
2
 
 
 
3
  namespace GeoIp2;
4
 
5
  interface ProviderInterface
9
  *
10
  * @return \GeoIp2\Model\Country a Country model for the requested IP address
11
  */
12
+ public function country($ipAddress);
13
 
14
  /**
15
  * @param string $ipAddress an IPv4 or IPv6 address to lookup
16
  *
17
  * @return \GeoIp2\Model\City a City model for the requested IP address
18
  */
19
+ public function city($ipAddress);
20
  }
vendor/geoip2/geoip2/src/Record/AbstractPlaceRecord.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  abstract class AbstractPlaceRecord extends AbstractRecord
@@ -10,8 +8,11 @@ abstract class AbstractPlaceRecord extends AbstractRecord
10
 
11
  /**
12
  * @ignore
 
 
 
13
  */
14
- public function __construct(?array $record, array $locales = ['en'])
15
  {
16
  $this->locales = $locales;
17
  parent::__construct($record);
@@ -19,8 +20,10 @@ abstract class AbstractPlaceRecord extends AbstractRecord
19
 
20
  /**
21
  * @ignore
 
 
22
  */
23
- public function __get(string $attr)
24
  {
25
  if ($attr === 'name') {
26
  return $this->name();
@@ -31,24 +34,26 @@ abstract class AbstractPlaceRecord extends AbstractRecord
31
 
32
  /**
33
  * @ignore
 
 
34
  */
35
- public function __isset(string $attr): bool
36
  {
37
  if ($attr === 'name') {
38
- return $this->firstSetNameLocale() !== null;
39
  }
40
 
41
  return parent::__isset($attr);
42
  }
43
 
44
- private function name(): ?string
45
  {
46
  $locale = $this->firstSetNameLocale();
47
 
48
  return $locale === null ? null : $this->names[$locale];
49
  }
50
 
51
- private function firstSetNameLocale(): ?string
52
  {
53
  foreach ($this->locales as $locale) {
54
  if (isset($this->names[$locale])) {
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  abstract class AbstractPlaceRecord extends AbstractRecord
8
 
9
  /**
10
  * @ignore
11
+ *
12
+ * @param mixed $record
13
+ * @param mixed $locales
14
  */
15
+ public function __construct($record, $locales = ['en'])
16
  {
17
  $this->locales = $locales;
18
  parent::__construct($record);
20
 
21
  /**
22
  * @ignore
23
+ *
24
+ * @param mixed $attr
25
  */
26
+ public function __get($attr)
27
  {
28
  if ($attr === 'name') {
29
  return $this->name();
34
 
35
  /**
36
  * @ignore
37
+ *
38
+ * @param mixed $attr
39
  */
40
+ public function __isset($attr)
41
  {
42
  if ($attr === 'name') {
43
+ return $this->firstSetNameLocale() === null ? false : true;
44
  }
45
 
46
  return parent::__isset($attr);
47
  }
48
 
49
+ private function name()
50
  {
51
  $locale = $this->firstSetNameLocale();
52
 
53
  return $locale === null ? null : $this->names[$locale];
54
  }
55
 
56
+ private function firstSetNameLocale()
57
  {
58
  foreach ($this->locales as $locale) {
59
  if (isset($this->names[$locale])) {
vendor/geoip2/geoip2/src/Record/AbstractRecord.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  abstract class AbstractRecord implements \JsonSerializable
@@ -10,16 +8,20 @@ abstract class AbstractRecord implements \JsonSerializable
10
 
11
  /**
12
  * @ignore
 
 
13
  */
14
- public function __construct(?array $record)
15
  {
16
  $this->record = isset($record) ? $record : [];
17
  }
18
 
19
  /**
20
  * @ignore
 
 
21
  */
22
- public function __get(string $attr)
23
  {
24
  // XXX - kind of ugly but greatly reduces boilerplate code
25
  $key = $this->attributeToKey($attr);
@@ -36,23 +38,23 @@ abstract class AbstractRecord implements \JsonSerializable
36
  throw new \RuntimeException("Unknown attribute: $attr");
37
  }
38
 
39
- public function __isset(string $attr): bool
40
  {
41
  return $this->validAttribute($attr) &&
42
  isset($this->record[$this->attributeToKey($attr)]);
43
  }
44
 
45
- private function attributeToKey(string $attr): string
46
  {
47
  return strtolower(preg_replace('/([A-Z])/', '_\1', $attr));
48
  }
49
 
50
- private function validAttribute(string $attr): bool
51
  {
52
  return \in_array($attr, $this->validAttributes, true);
53
  }
54
 
55
- public function jsonSerialize(): ?array
56
  {
57
  return $this->record;
58
  }
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  abstract class AbstractRecord implements \JsonSerializable
8
 
9
  /**
10
  * @ignore
11
+ *
12
+ * @param mixed $record
13
  */
14
+ public function __construct($record)
15
  {
16
  $this->record = isset($record) ? $record : [];
17
  }
18
 
19
  /**
20
  * @ignore
21
+ *
22
+ * @param mixed $attr
23
  */
24
+ public function __get($attr)
25
  {
26
  // XXX - kind of ugly but greatly reduces boilerplate code
27
  $key = $this->attributeToKey($attr);
38
  throw new \RuntimeException("Unknown attribute: $attr");
39
  }
40
 
41
+ public function __isset($attr)
42
  {
43
  return $this->validAttribute($attr) &&
44
  isset($this->record[$this->attributeToKey($attr)]);
45
  }
46
 
47
+ private function attributeToKey($attr)
48
  {
49
  return strtolower(preg_replace('/([A-Z])/', '_\1', $attr));
50
  }
51
 
52
+ private function validAttribute($attr)
53
  {
54
  return \in_array($attr, $this->validAttributes, true);
55
  }
56
 
57
+ public function jsonSerialize()
58
  {
59
  return $this->record;
60
  }
vendor/geoip2/geoip2/src/Record/City.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  /**
vendor/geoip2/geoip2/src/Record/Continent.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  /**
vendor/geoip2/geoip2/src/Record/Country.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  /**
vendor/geoip2/geoip2/src/Record/Location.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  /**
vendor/geoip2/geoip2/src/Record/MaxMind.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  /**
vendor/geoip2/geoip2/src/Record/Postal.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  /**
vendor/geoip2/geoip2/src/Record/RepresentedCountry.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  /**
vendor/geoip2/geoip2/src/Record/Subdivision.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  /**
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  /**
vendor/geoip2/geoip2/src/Record/Traits.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\Record;
6
 
7
  use GeoIp2\Util;
@@ -58,9 +56,6 @@ use GeoIp2\Util;
58
  * @property-read bool $isPublicProxy This is true if the IP address belongs to
59
  * a public proxy. This property is only available from GeoIP2 Precision
60
  * Insights.
61
- * @property-read bool $isResidentialProxy This is true if the IP address is
62
- * on a suspected anonymizing network and belongs to a residential ISP. This
63
- * property is only available from GeoIP2 Precision Insights.
64
  * @property-read bool $isSatelliteProvider *Deprecated.* Due to the
65
  * increased coverage by mobile carriers, very few satellite providers now
66
  * serve multiple countries. As a result, the output does not provide
@@ -125,7 +120,6 @@ class Traits extends AbstractRecord
125
  'isLegitimateProxy',
126
  'isp',
127
  'isPublicProxy',
128
- 'isResidentialProxy',
129
  'isSatelliteProvider',
130
  'isTorExitNode',
131
  'network',
@@ -135,7 +129,7 @@ class Traits extends AbstractRecord
135
  'userType',
136
  ];
137
 
138
- public function __construct(?array $record)
139
  {
140
  if (!isset($record['network']) && isset($record['ip_address']) && isset($record['prefix_len'])) {
141
  $record['network'] = Util::cidr($record['ip_address'], $record['prefix_len']);
1
  <?php
2
 
 
 
3
  namespace GeoIp2\Record;
4
 
5
  use GeoIp2\Util;
56
  * @property-read bool $isPublicProxy This is true if the IP address belongs to
57
  * a public proxy. This property is only available from GeoIP2 Precision
58
  * Insights.
 
 
 
59
  * @property-read bool $isSatelliteProvider *Deprecated.* Due to the
60
  * increased coverage by mobile carriers, very few satellite providers now
61
  * serve multiple countries. As a result, the output does not provide
120
  'isLegitimateProxy',
121
  'isp',
122
  'isPublicProxy',
 
123
  'isSatelliteProvider',
124
  'isTorExitNode',
125
  'network',
129
  'userType',
130
  ];
131
 
132
+ public function __construct($record)
133
  {
134
  if (!isset($record['network']) && isset($record['ip_address']) && isset($record['prefix_len'])) {
135
  $record['network'] = Util::cidr($record['ip_address'], $record['prefix_len']);
vendor/geoip2/geoip2/src/Util.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2;
6
 
7
  class Util
@@ -12,8 +10,11 @@ class Util
12
  *
13
  * @internal
14
  * @ignore
 
 
 
15
  */
16
- public static function cidr(string $ipAddress, int $prefixLen): string
17
  {
18
  $ipBytes = inet_pton($ipAddress);
19
  $networkBytes = str_repeat("\0", \strlen($ipBytes));
1
  <?php
2
 
 
 
3
  namespace GeoIp2;
4
 
5
  class Util
10
  *
11
  * @internal
12
  * @ignore
13
+ *
14
+ * @param mixed $ipAddress
15
+ * @param mixed $prefixLen
16
  */
17
+ public static function cidr($ipAddress, $prefixLen)
18
  {
19
  $ipBytes = inet_pton($ipAddress);
20
  $networkBytes = str_repeat("\0", \strlen($ipBytes));
vendor/geoip2/geoip2/src/WebService/Client.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
 
3
- declare(strict_types=1);
4
-
5
  namespace GeoIp2\WebService;
6
 
7
  use GeoIp2\Exception\AddressNotFoundException;
@@ -49,7 +47,7 @@ class Client implements ProviderInterface
49
  private $client;
50
  private static $basePath = '/geoip/v2.1';
51
 
52
- const VERSION = 'v2.11.0';
53
 
54
  /**
55
  * Constructor.
@@ -67,10 +65,10 @@ class Client implements ProviderInterface
67
  * `http://username:password@127.0.0.1:10`.
68
  */
69
  public function __construct(
70
- int $accountId,
71
- string $licenseKey,
72
- array $locales = ['en'],
73
- array $options = []
74
  ) {
75
  $this->locales = $locales;
76
 
@@ -89,7 +87,7 @@ class Client implements ProviderInterface
89
  $this->client = new WsClient($accountId, $licenseKey, $options);
90
  }
91
 
92
- private function userAgent(): string
93
  {
94
  return 'GeoIP2-API/' . self::VERSION;
95
  }
@@ -117,8 +115,10 @@ class Client implements ProviderInterface
117
  * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
118
  * class to the above exceptions. It will be thrown directly
119
  * if a 200 status code is returned but the body is invalid.
 
 
120
  */
121
- public function city(string $ipAddress = 'me'): \GeoIp2\Model\City
122
  {
123
  return $this->responseFor('city', 'City', $ipAddress);
124
  }
@@ -146,8 +146,10 @@ class Client implements ProviderInterface
146
  * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent class to the above exceptions. It
147
  * will be thrown directly if a 200 status code is returned but
148
  * the body is invalid.
 
 
149
  */
150
- public function country(string $ipAddress = 'me'): \GeoIp2\Model\Country
151
  {
152
  return $this->responseFor('country', 'Country', $ipAddress);
153
  }
@@ -175,13 +177,15 @@ class Client implements ProviderInterface
175
  * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
176
  * class to the above exceptions. It will be thrown directly
177
  * if a 200 status code is returned but the body is invalid.
 
 
178
  */
179
- public function insights(string $ipAddress = 'me'): \GeoIp2\Model\Insights
180
  {
181
  return $this->responseFor('insights', 'Insights', $ipAddress);
182
  }
183
 
184
- private function responseFor(string $endpoint, string $class, string $ipAddress)
185
  {
186
  $path = implode('/', [self::$basePath, $endpoint, $ipAddress]);
187
 
1
  <?php
2
 
 
 
3
  namespace GeoIp2\WebService;
4
 
5
  use GeoIp2\Exception\AddressNotFoundException;
47
  private $client;
48
  private static $basePath = '/geoip/v2.1';
49
 
50
+ const VERSION = 'v2.10.0';
51
 
52
  /**
53
  * Constructor.
65
  * `http://username:password@127.0.0.1:10`.
66
  */
67
  public function __construct(
68
+ $accountId,
69
+ $licenseKey,
70
+ $locales = ['en'],
71
+ $options = []
72
  ) {
73
  $this->locales = $locales;
74
 
87
  $this->client = new WsClient($accountId, $licenseKey, $options);
88
  }
89
 
90
+ private function userAgent()
91
  {
92
  return 'GeoIP2-API/' . self::VERSION;
93
  }
115
  * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
116
  * class to the above exceptions. It will be thrown directly
117
  * if a 200 status code is returned but the body is invalid.
118
+ *
119
+ * @return \GeoIp2\Model\City
120
  */
121
+ public function city($ipAddress = 'me')
122
  {
123
  return $this->responseFor('city', 'City', $ipAddress);
124
  }
146
  * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent class to the above exceptions. It
147
  * will be thrown directly if a 200 status code is returned but
148
  * the body is invalid.
149
+ *
150
+ * @return \GeoIp2\Model\Country
151
  */
152
+ public function country($ipAddress = 'me')
153
  {
154
  return $this->responseFor('country', 'Country', $ipAddress);
155
  }
177
  * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent
178
  * class to the above exceptions. It will be thrown directly
179
  * if a 200 status code is returned but the body is invalid.
180
+ *
181
+ * @return \GeoIp2\Model\Insights
182
  */
183
+ public function insights($ipAddress = 'me')
184
  {
185
  return $this->responseFor('insights', 'Insights', $ipAddress);
186
  }
187
 
188
+ private function responseFor($endpoint, $class, $ipAddress)
189
  {
190
  $path = implode('/', [self::$basePath, $endpoint, $ipAddress]);
191