Skip to content

Commit d8ecb56

Browse files
committed
Upgrade geoip2/geoip2
1 parent da1d714 commit d8ecb56

File tree

3 files changed

+75
-74
lines changed

3 files changed

+75
-74
lines changed

composer.json

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
{
2-
"name": "interaction-design-foundation/laravel-geoip",
3-
"description": "Support for multiple GeoIP services.",
4-
"license": "BSD-2-Clause",
5-
"keywords": [
6-
"laravel",
7-
"geoip",
8-
"location",
9-
"geolocation",
10-
"MaxMind",
11-
"IP API",
12-
"infoDB"
13-
],
14-
"require": {
15-
"php": "^8.1",
16-
"illuminate/cache": "^10.0 || ^11.0",
17-
"illuminate/console": "^10.0 || ^11.0",
18-
"illuminate/support": "^10.0 || ^11.0"
19-
},
20-
"require-dev": {
21-
"friendsofphp/php-cs-fixer": "^3.50",
22-
"geoip2/geoip2": "^2.11",
23-
"mockery/mockery": "^1.6",
24-
"phpstan/phpstan": "^1.10",
25-
"phpunit/phpunit": "^10.5 || ^11.0",
26-
"squizlabs/php_codesniffer": "^3.9",
27-
"vimeo/psalm": "^5.22",
28-
"vlucas/phpdotenv": "^5.4"
29-
},
30-
"suggest": {
31-
"geoip2/geoip2": "Required to use the MaxMind database or web service with GeoIP (~2.1).",
32-
"monolog/monolog": "Allows for storing location not found errors to the log"
33-
},
34-
"autoload": {
35-
"psr-4": {
36-
"InteractionDesignFoundation\\GeoIP\\": "src/"
37-
},
38-
"files": [
39-
"src/helpers.php"
40-
]
41-
},
42-
"autoload-dev": {
43-
"psr-4": {
44-
"InteractionDesignFoundation\\GeoIP\\Tests\\": "tests/"
45-
},
46-
"files": [
47-
"tests/TestFunctions.php"
48-
]
49-
},
50-
"config": {
51-
"sort-packages": true
52-
},
53-
"extra": {
54-
"laravel": {
55-
"aliases": {
56-
"GeoIP": "InteractionDesignFoundation\\GeoIP\\Facades\\GeoIP"
57-
},
58-
"providers": [
59-
"InteractionDesignFoundation\\GeoIP\\GeoIPServiceProvider"
60-
]
61-
}
62-
},
63-
"scripts": {
64-
"cs": "@php-cs-fixer",
65-
"php-cs-fixer": "@php -d memory_limit=-1 vendor/bin/php-cs-fixer fix --no-interaction --ansi --verbose",
66-
"phpcs": "vendor/bin/phpcs --standard=phpcs.xml src",
67-
"phpstan": "vendor/bin/phpstan --level=0 --no-progress analyse --configuration phpstan.neon --memory-limit 2G",
68-
"psalm": "vendor/bin/psalm",
69-
"test": "vendor/bin/phpunit"
70-
}
71-
}
1+
{
2+
"name": "interaction-design-foundation/laravel-geoip",
3+
"description": "Support for multiple GeoIP services.",
4+
"license": "BSD-2-Clause",
5+
"keywords": [
6+
"laravel",
7+
"geoip",
8+
"location",
9+
"geolocation",
10+
"MaxMind",
11+
"IP API",
12+
"infoDB"
13+
],
14+
"require": {
15+
"php": "^8.1",
16+
"illuminate/cache": "^10.0 || ^11.0",
17+
"illuminate/console": "^10.0 || ^11.0",
18+
"illuminate/support": "^10.0 || ^11.0"
19+
},
20+
"require-dev": {
21+
"friendsofphp/php-cs-fixer": "^3.50",
22+
"geoip2/geoip2": "^3.0",
23+
"mockery/mockery": "^1.6",
24+
"phpstan/phpstan": "^1.10",
25+
"phpunit/phpunit": "^10.5 || ^11.0",
26+
"squizlabs/php_codesniffer": "^3.9",
27+
"vimeo/psalm": "^5.22",
28+
"vlucas/phpdotenv": "^5.4"
29+
},
30+
"suggest": {
31+
"geoip2/geoip2": "Required to use the MaxMind database or web service with GeoIP (~2.1).",
32+
"monolog/monolog": "Allows for storing location not found errors to the log"
33+
},
34+
"autoload": {
35+
"psr-4": {
36+
"InteractionDesignFoundation\\GeoIP\\": "src/"
37+
},
38+
"files": [
39+
"src/helpers.php"
40+
]
41+
},
42+
"autoload-dev": {
43+
"psr-4": {
44+
"InteractionDesignFoundation\\GeoIP\\Tests\\": "tests/"
45+
},
46+
"files": [
47+
"tests/TestFunctions.php"
48+
]
49+
},
50+
"config": {
51+
"sort-packages": true
52+
},
53+
"extra": {
54+
"laravel": {
55+
"aliases": {
56+
"GeoIP": "InteractionDesignFoundation\\GeoIP\\Facades\\GeoIP"
57+
},
58+
"providers": [
59+
"InteractionDesignFoundation\\GeoIP\\GeoIPServiceProvider"
60+
]
61+
}
62+
},
63+
"scripts": {
64+
"cs": "@php-cs-fixer",
65+
"php-cs-fixer": "@php -d memory_limit=-1 vendor/bin/php-cs-fixer fix --no-interaction --ansi --verbose",
66+
"phpcs": "vendor/bin/phpcs --standard=phpcs.xml src",
67+
"phpstan": "vendor/bin/phpstan --level=0 --no-progress analyse --configuration phpstan.neon --memory-limit 2G",
68+
"psalm": "vendor/bin/psalm",
69+
"test": "vendor/bin/phpunit"
70+
}
71+
}

src/Contracts/ServiceInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public function boot();
2323
* @param string $ip
2424
*
2525
* @return \InteractionDesignFoundation\GeoIP\Location
26+
*
27+
* @throws \InvalidArgumentException if an invalid IP address is passed
2628
*/
2729
public function locate($ip);
2830

src/Services/IPFinder.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace InteractionDesignFoundation\GeoIP\Services;
66

7-
use Exception;
87
use InteractionDesignFoundation\GeoIP\Support\HttpClient;
98

109
class IPFinder extends AbstractService
@@ -36,7 +35,7 @@ public function boot()
3635

3736
/**
3837
* {@inheritDoc}
39-
* @throws Exception
38+
* @throws \Exception
4039
*/
4140
public function locate($ip)
4241
{
@@ -45,7 +44,7 @@ public function locate($ip)
4544

4645
// Verify server response
4746
if ($this->client->getErrors() !== null || empty($data[0])) {
48-
throw new Exception('Request failed (' . $this->client->getErrors() . ')');
47+
throw new \Exception('Request failed (' . $this->client->getErrors() . ')');
4948
}
5049

5150
$json = json_decode($data[0], true);

0 commit comments

Comments
 (0)