Skip to content

Commit ae7bc7b

Browse files
authored
Merge pull request #231 from maxmind/greg/release
Release 3.1.0
2 parents 279446f + c86fbea commit ae7bc7b

30 files changed

+166
-59
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup PHP
1515
uses: shivammathur/setup-php@v2
1616
with:
17-
php-version: 8.2
17+
php-version: 8.3
1818

1919
- name: Checkout
2020
uses: actions/checkout@v4

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
operating-system: [ubuntu-latest, windows-latest, macos-latest]
15-
php-versions: ['8.1', '8.2']
15+
php-versions: ['8.1', '8.2', '8.3', '8.4']
1616
name: "PHP ${{ matrix.php-versions }} test on ${{ matrix.operating-system }}"
1717
steps:
1818
- name: Setup PHP

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ _site
22
.gh-pages
33
.idea
44
.php_cs.cache
5+
.php-cs-fixer.cache
56
.phpunit.cache/
67
.phpunit.result.cache
78
GeoLite2-City.mmdb

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
CHANGELOG
22
=========
33

4+
3.1.0 (2024-11-15)
5+
------------------
6+
7+
* This library no longer uses implicitly nullable parameter types. This
8+
will fix deprecation warning in PHP 8.4. Reported by Steven Lewis.
9+
GitHub #230.
10+
* The PHPDoc type hints have been improved for use with PHPStan.
11+
412
3.0.0 (2023-12-04)
513
------------------
614

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,6 @@ The GeoIP2 PHP API uses [Semantic Versioning](https://semver.org/).
443443

444444
## Copyright and License ##
445445

446-
This software is Copyright (c) 2013-2023 by MaxMind, Inc.
446+
This software is Copyright (c) 2013-2024 by MaxMind, Inc.
447447

448448
This is free software, licensed under the Apache License, Version 2.0.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
}
1414
],
1515
"require": {
16-
"maxmind-db/reader": "^1.11.1",
17-
"maxmind/web-service-common": "~0.8",
16+
"maxmind-db/reader": "^1.12.0",
17+
"maxmind/web-service-common": "~0.10",
1818
"php": ">=8.1",
1919
"ext-json": "*"
2020
},

dev-bin/release.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ php composer.phar update --no-dev
4545
perl -pi -e "s/(?<=const VERSION = ').+?(?=';)/$tag/g" src/WebService/Client.php
4646

4747

48-
box_phar_hash='c24c400c424a68041d7af146c71943bf1acc0c5abafa45297c503b832b9c6b16 box.phar'
48+
box_phar_hash='8d12a7d69a5003a80bd603ea95a8f3dcea30b9a2ad84cd7cb15b8193929def9e box.phar'
4949

5050
if ! echo "$box_phar_hash" | sha256sum -c; then
51-
wget -O box.phar "https://github.com/box-project/box/releases/download/4.5.1/box.phar"
51+
wget -O box.phar "https://github.com/box-project/box/releases/download/4.6.1/box.phar"
5252
fi
5353

5454
echo "$box_phar_hash" | sha256sum -c
@@ -93,10 +93,10 @@ if [ -n "$(git status --porcelain)" ]; then
9393
fi
9494

9595
# Using Composer is possible, but they don't recommend it.
96-
phpdocumentor_phar_hash='bad7e4b8c99e73391bb3183a127593ecd1cd66ae42b4a33efe495d193e257f04 phpDocumentor.phar'
96+
phpdocumentor_phar_hash='9760ac280a10041928a8743354f68692c22f14cd5d05135dfc15e11d3b3c25ea phpDocumentor.phar'
9797

9898
if ! echo "$phpdocumentor_phar_hash" | sha256sum -c; then
99-
wget -O phpDocumentor.phar https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.4.3/phpDocumentor.phar
99+
wget -O phpDocumentor.phar https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.5.3/phpDocumentor.phar
100100
fi
101101

102102
echo "$phpdocumentor_phar_hash" | sha256sum -c

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ parameters:
33
paths:
44
- src
55
- tests
6-
checkMissingIterableValueType: false
7-

src/Database/Reader.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class Reader implements ProviderInterface
5656
/**
5757
* Constructor.
5858
*
59-
* @param string $filename the path to the GeoIP2 database file
60-
* @param array $locales list of locale codes to use in name property
61-
* from most preferred to least preferred
59+
* @param string $filename the path to the GeoIP2 database file
60+
* @param array<string> $locales list of locale codes to use in name property
61+
* from most preferred to least preferred
6262
*
6363
* @throws InvalidDatabaseException if the database is corrupt or invalid
6464
*/
@@ -215,6 +215,9 @@ private function flatModelFor(string $class, string $type, string $ipAddress): o
215215
return new $class($record);
216216
}
217217

218+
/**
219+
* @return array{0:array<string, mixed>, 1:int}
220+
*/
218221
private function getRecord(string $class, string $type, string $ipAddress): array
219222
{
220223
if (!str_contains($this->dbType, $type)) {

src/Model/AnonymousIp.php

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class AnonymousIp implements \JsonSerializable
6464

6565
/**
6666
* @ignore
67+
*
68+
* @param array<string, mixed> $raw
6769
*/
6870
public function __construct(array $raw)
6971
{
@@ -78,27 +80,18 @@ public function __construct(array $raw)
7880
$this->network = Util::cidr($ipAddress, $raw['prefix_len']);
7981
}
8082

83+
/**
84+
* @return array<string, mixed>|null
85+
*/
8186
public function jsonSerialize(): ?array
8287
{
8388
$js = [];
84-
if ($this->isAnonymous !== null) {
85-
$js['is_anonymous'] = $this->isAnonymous;
86-
}
87-
if ($this->isAnonymousVpn !== null) {
88-
$js['is_anonymous_vpn'] = $this->isAnonymousVpn;
89-
}
90-
if ($this->isHostingProvider !== null) {
91-
$js['is_hosting_provider'] = $this->isHostingProvider;
92-
}
93-
if ($this->isPublicProxy !== null) {
94-
$js['is_public_proxy'] = $this->isPublicProxy;
95-
}
96-
if ($this->isResidentialProxy !== null) {
97-
$js['is_residential_proxy'] = $this->isResidentialProxy;
98-
}
99-
if ($this->isTorExitNode !== null) {
100-
$js['is_tor_exit_node'] = $this->isTorExitNode;
101-
}
89+
$js['is_anonymous'] = $this->isAnonymous;
90+
$js['is_anonymous_vpn'] = $this->isAnonymousVpn;
91+
$js['is_hosting_provider'] = $this->isHostingProvider;
92+
$js['is_public_proxy'] = $this->isPublicProxy;
93+
$js['is_residential_proxy'] = $this->isResidentialProxy;
94+
$js['is_tor_exit_node'] = $this->isTorExitNode;
10295
$js['ip_address'] = $this->ipAddress;
10396
$js['network'] = $this->network;
10497

0 commit comments

Comments
 (0)