Skip to content

Commit 4e74565

Browse files
Add support for PHP 8.5
1 parent 96dd87a commit 4e74565

File tree

6 files changed

+22
-36
lines changed

6 files changed

+22
-36
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
operating-system: [ ubuntu-latest ]
11-
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
11+
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
1212
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1313

1414
steps:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2025 odan
3+
Copyright (c) 2026 odan
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A strictly typed array reader for PHP.
99

1010
## Requirements
1111

12-
* PHP 8.1 - 8.4
12+
* PHP 8.2 - 8.5
1313

1414
## Installation
1515

composer.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
],
1414
"homepage": "https://github.com/selective-php/array-reader",
1515
"require": {
16-
"php": "8.1.* || 8.2.* || 8.3.* || 8.4.*",
16+
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
1717
"cakephp/chronos": "^2 || ^3"
1818
},
1919
"require-dev": {
2020
"friendsofphp/php-cs-fixer": "^3",
2121
"phpstan/phpstan": "^1 || ^2",
22-
"phpunit/phpunit": "^10",
22+
"phpunit/phpunit": "^11",
2323
"squizlabs/php_codesniffer": "^3"
2424
},
2525
"autoload": {
@@ -37,12 +37,10 @@
3737
},
3838
"scripts": {
3939
"cs:check": [
40-
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
41-
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
40+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi --allow-unsupported-php-version=yes"
4241
],
4342
"cs:fix": [
44-
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
45-
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
43+
"php-cs-fixer fix --config=.cs.php --ansi --verbose --allow-unsupported-php-version=yes"
4644
],
4745
"sniffer:check": "phpcs --standard=phpcs.xml",
4846
"sniffer:fix": "phpcbf --standard=phpcs.xml",

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
bootstrap="vendor/autoload.php"
44
colors="true"
55
backupGlobals="false"
6-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
6+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
77
cacheDirectory=".phpunit.cache"
88
backupStaticProperties="false">
99
<coverage/>

tests/ArrayReaderTest.php

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Selective\ArrayReader\Test;
44

55
use InvalidArgumentException;
6+
use PHPUnit\Framework\Attributes\DataProvider;
67
use PHPUnit\Framework\TestCase;
78
use Selective\ArrayReader\ArrayReader;
89

@@ -14,15 +15,14 @@ class ArrayReaderTest extends TestCase
1415
/**
1516
* Test.
1617
*
17-
* @dataProvider providerGetInt
18-
*
1918
* @param mixed $data The data
2019
* @param string|int $key The lookup key
2120
* @param mixed $default The default value
2221
* @param mixed $expected The expected value
2322
*
2423
* @return void
2524
*/
25+
#[DataProvider('providerGetInt')]
2626
public function testCreateFromArray($data, $key, $default, $expected): void
2727
{
2828
$reader = ArrayReader::createFromArray($data);
@@ -32,15 +32,14 @@ public function testCreateFromArray($data, $key, $default, $expected): void
3232
/**
3333
* Test.
3434
*
35-
* @dataProvider providerGetInt
36-
*
3735
* @param mixed $data The data
3836
* @param string|key $key The lookup key
3937
* @param mixed $default The default value
4038
* @param mixed $expected The expected value
4139
*
4240
* @return void
4341
*/
42+
#[DataProvider('providerGetInt')]
4443
public function testGetInt($data, $key, $default, $expected): void
4544
{
4645
$reader = new ArrayReader($data);
@@ -50,14 +49,13 @@ public function testGetInt($data, $key, $default, $expected): void
5049
/**
5150
* Test.
5251
*
53-
* @dataProvider providerGetIntError
54-
*
5552
* @param mixed $data The data
5653
* @param string|int $key The lookup key
5754
* @param mixed $default The default value
5855
*
5956
* @return void
6057
*/
58+
#[DataProvider('providerGetIntError')]
6159
public function testGetIntError($data, $key, $default): void
6260
{
6361
$reader = new ArrayReader($data);
@@ -70,15 +68,14 @@ public function testGetIntError($data, $key, $default): void
7068
/**
7169
* Test.
7270
*
73-
* @dataProvider providerFindInt
74-
*
7571
* @param mixed $data The data
7672
* @param string|int $key The lookup key
7773
* @param mixed $default The default value
7874
* @param mixed $expected The expected value
7975
*
8076
* @return void
8177
*/
78+
#[DataProvider('providerFindInt')]
8279
public function testFindInt($data, $key, $default, $expected): void
8380
{
8481
$reader = new ArrayReader($data);
@@ -88,15 +85,14 @@ public function testFindInt($data, $key, $default, $expected): void
8885
/**
8986
* Test.
9087
*
91-
* @dataProvider providerGetFloat
92-
*
9388
* @param mixed $data The data
9489
* @param string|key $key The lookup key
9590
* @param mixed $default The default value
9691
* @param mixed $expected The expected value
9792
*
9893
* @return void
9994
*/
95+
#[DataProvider('providerGetFloat')]
10096
public function testGetFloat($data, $key, $default, $expected): void
10197
{
10298
$reader = new ArrayReader($data);
@@ -106,14 +102,13 @@ public function testGetFloat($data, $key, $default, $expected): void
106102
/**
107103
* Test.
108104
*
109-
* @dataProvider providerGetFloatError
110-
*
111105
* @param mixed $data The data
112106
* @param string|int $key The lookup key
113107
* @param mixed $default The default value
114108
*
115109
* @return void
116110
*/
111+
#[DataProvider('providerGetFloatError')]
117112
public function testGetFloatError($data, $key, $default): void
118113
{
119114
$reader = new ArrayReader($data);
@@ -126,15 +121,14 @@ public function testGetFloatError($data, $key, $default): void
126121
/**
127122
* Test.
128123
*
129-
* @dataProvider providerFindFloat
130-
*
131124
* @param mixed $data The data
132125
* @param string|int $key The lookup key
133126
* @param mixed $default The default value
134127
* @param mixed $expected The expected value
135128
*
136129
* @return void
137130
*/
131+
#[DataProvider('providerFindFloat')]
138132
public function testFindFloat($data, $key, $default, $expected): void
139133
{
140134
$reader = new ArrayReader($data);
@@ -238,15 +232,14 @@ public static function providerFindFloat(): array
238232
/**
239233
* Test.
240234
*
241-
* @dataProvider providerGetString
242-
*
243235
* @param mixed $data The data
244236
* @param string $key The lookup key
245237
* @param mixed $default The default value
246238
* @param mixed $expected The expected value
247239
*
248240
* @return void
249241
*/
242+
#[DataProvider('providerGetString')]
250243
public function testGetString($data, string $key, $default, $expected): void
251244
{
252245
$reader = new ArrayReader($data);
@@ -273,13 +266,12 @@ public static function providerGetString(): array
273266
/**
274267
* Test.
275268
*
276-
* @dataProvider providerGetStringError
277-
*
278269
* @param mixed $data The data
279270
* @param string $key The lookup key
280271
*
281272
* @return void
282273
*/
274+
#[DataProvider('providerGetStringError')]
283275
public function testGetStringError($data, string $key): void
284276
{
285277
$this->expectException(InvalidArgumentException::class);
@@ -308,15 +300,14 @@ public static function providerGetStringError(): array
308300
/**
309301
* Test.
310302
*
311-
* @dataProvider providerFindString
312-
*
313303
* @param mixed $data The data
314304
* @param string $key The lookup key
315305
* @param mixed $default The default value
316306
* @param mixed $expected The expected value
317307
*
318308
* @return void
319309
*/
310+
#[DataProvider('providerFindString')]
320311
public function testFindString($data, string $key, $default, $expected): void
321312
{
322313
$reader = new ArrayReader($data);
@@ -343,15 +334,14 @@ public static function providerFindString(): array
343334
/**
344335
* Test.
345336
*
346-
* @dataProvider providerGetArray
347-
*
348337
* @param mixed $data The data
349338
* @param string|int $key The lookup key
350339
* @param mixed $default The default value
351340
* @param mixed $expected The expected value
352341
*
353342
* @return void
354343
*/
344+
#[DataProvider('providerGetArray')]
355345
public function testGetArray($data, $key, $default, $expected): void
356346
{
357347
$reader = new ArrayReader($data);
@@ -376,14 +366,13 @@ public static function providerGetArray(): array
376366
/**
377367
* Test.
378368
*
379-
* @dataProvider providerGetArrayError
380-
*
381369
* @param mixed $data The data
382370
* @param string|int $key The lookup key
383371
* @param mixed $default The default value
384372
*
385373
* @return void
386374
*/
375+
#[DataProvider('providerGetArrayError')]
387376
public function testGetArrayError($data, $key, $default): void
388377
{
389378
$reader = new ArrayReader($data);
@@ -409,15 +398,14 @@ public static function providerGetArrayError(): array
409398
/**
410399
* Test.
411400
*
412-
* @dataProvider providerFindArray
413-
*
414401
* @param mixed $data The data
415402
* @param string|int $key The lookup key
416403
* @param mixed $default The default value
417404
* @param mixed $expected The expected value
418405
*
419406
* @return void
420407
*/
408+
#[DataProvider('providerFindArray')]
421409
public function testFindArray($data, $key, $default, $expected): void
422410
{
423411
$reader = new ArrayReader($data);

0 commit comments

Comments
 (0)