Skip to content

Commit f06a3e2

Browse files
authored
Merge pull request #175 from maxmind/greg/release
Release 1.12.0
2 parents 87906bb + 5b2d7a7 commit f06a3e2

File tree

14 files changed

+79
-38
lines changed

14 files changed

+79
-38
lines changed

.github/workflows/clang-analyzer.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.1
17+
php-version: 8.4
1818
tools: composer, phpize
1919

2020
- name: Checkout

.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.1
17+
php-version: 8.3
1818

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

.github/workflows/test.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,20 @@ jobs:
1414
matrix:
1515
arch: ["amd64", "i386"]
1616
operating-system: [ubuntu-latest]
17-
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
18-
php-extensions: ['bcmath', 'gmp']
19-
name: "PHP ${{ matrix.php-versions }} (with ${{ matrix.php-extensions }}) test on ${{ matrix.operating-system }}/${{ matrix.arch }}"
17+
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
18+
php-extension: ['bcmath', 'gmp']
19+
exclude:
20+
# We are getting weird libxml2 failures on this combo
21+
- arch: "i386"
22+
php-version: 8.4
23+
24+
name: "PHP ${{ matrix.php-version }} (with ${{ matrix.php-extension }}) test on ${{ matrix.operating-system }}/${{ matrix.arch }}"
2025
steps:
2126
- name: Install PHP
2227
uses: shivammathur/setup-php@v2
2328
with:
24-
php-version: ${{ matrix.php-versions }}
25-
extensions: "mbstring, intl, ${{ matrix.php-extensions }}"
29+
php-version: ${{ matrix.php-version }}
30+
extensions: "mbstring, intl, ${{ matrix.php-extension }}"
2631
tools: "composer, phpize"
2732

2833
- name: Checkout

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
CHANGELOG
22
=========
33

4-
1.12.0
4+
1.12.0 (2024-11-14)
55
-------------------
66

77
* Improve the error handling when the user tries to open a directory
88
with the pure PHP reader.
9+
* Improve the typehints on arrays in the PHPDocs.
910

1011
1.11.1 (2023-12-01)
1112
-------------------

README.md

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

181181
## Copyright and License ##
182182

183-
This software is Copyright (c) 2014-2023 by MaxMind, Inc.
183+
This software is Copyright (c) 2014-2024 by MaxMind, Inc.
184184

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

ext/php_maxminddb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#ifndef PHP_MAXMINDDB_H
1717
#define PHP_MAXMINDDB_H 1
18-
#define PHP_MAXMINDDB_VERSION "1.11.1"
18+
#define PHP_MAXMINDDB_VERSION "1.12.0"
1919
#define PHP_MAXMINDDB_EXTNAME "maxminddb"
2020

2121
extern zend_module_entry maxminddb_module_entry;

package.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
<email>[email protected]</email>
1515
<active>yes</active>
1616
</lead>
17-
<date>2023-12-01</date>
17+
<date>2024-11-14</date>
1818
<version>
19-
<release>1.11.1</release>
20-
<api>1.11.1</api>
19+
<release>1.12.0</release>
20+
<api>1.12.0</api>
2121
</version>
2222
<stability>
2323
<release>stable</release>
2424
<api>stable</api>
2525
</stability>
2626
<license uri="https://github.com/maxmind/MaxMind-DB-Reader-php/blob/main/LICENSE">Apache License 2.0</license>
27-
<notes>* Resolve warnings when compiling the C extension.
28-
* Fix various type issues detected by PHPStan level. Pull request by
29-
LauraTaylorUK. GitHub #160.</notes>
27+
<notes>* Improve the error handling when the user tries to open a directory
28+
with the pure PHP reader.
29+
* Improve the typehints on arrays in the PHPDocs.</notes>
3030
<contents>
3131
<dir name="/">
3232
<file role="doc" name="LICENSE"/>

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-

phpunit.xml.dist

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit bootstrap="./vendor/autoload.php" colors="true">
4-
<testsuites>
5-
<testsuite name="MaxMind DB Test Suite">
6-
<directory suffix="Test.php">./tests/MaxMind/Db/Test/</directory>
7-
</testsuite>
8-
</testsuites>
9-
10-
<filter>
11-
<whitelist>
12-
<directory suffix=".php">./src/MaxMind/Db/</directory>
13-
</whitelist>
14-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">./src/MaxMind/Db/</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="MaxMind DB Test Suite">
10+
<directory suffix="Test.php">./tests/MaxMind/Db/Test/</directory>
11+
</testsuite>
12+
</testsuites>
1513
</phpunit>

src/MaxMind/Db/Reader.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ public function get(string $ipAddress)
149149
* if the database is invalid or there is an error reading
150150
* from it
151151
*
152-
* @return array an array where the first element is the record and the
153-
* second the network prefix length for the record
152+
* @return array{0:mixed, 1:int} an array where the first element is the record and the
153+
* second the network prefix length for the record
154154
*/
155155
public function getWithPrefixLen(string $ipAddress): array
156156
{
@@ -174,6 +174,9 @@ public function getWithPrefixLen(string $ipAddress): array
174174
return [$this->resolveDataPointer($pointer), $prefixLen];
175175
}
176176

177+
/**
178+
* @return array{0:int, 1:int}
179+
*/
177180
private function findAddressInTree(string $ipAddress): array
178181
{
179182
$packedAddr = @inet_pton($ipAddress);

0 commit comments

Comments
 (0)