Skip to content

Commit b1b9b34

Browse files
committed
Change minimum to PHP 8.1
1 parent a6abbd3 commit b1b9b34

File tree

6 files changed

+57
-81
lines changed

6 files changed

+57
-81
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 7 deletions
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: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
11+
php-versions: [ '8.1', '8.2' ]
1212
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1313

1414
steps:
@@ -34,12 +34,7 @@ jobs:
3434
- name: Validate composer.json and composer.lock
3535
run: composer validate
3636

37-
- name: Install dependencies for PHP 7
38-
if: matrix.php-versions < '8.0'
39-
run: composer update --prefer-dist --no-progress
40-
41-
- name: Install dependencies for PHP 8
42-
if: matrix.php-versions >= '8.0'
37+
- name: Install dependencies
4338
run: composer update --prefer-dist --no-progress --ignore-platform-req=php
4439

4540
- name: Run test suite

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A strictly typed configuration component for PHP. Inspired by [Apache Commons Co
1212

1313
## Requirements
1414

15-
* PHP 7.2+ or 8
15+
* PHP 8.1+
1616

1717
## Installation
1818

composer.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
],
1414
"homepage": "https://github.com/selective-php/config",
1515
"require": {
16-
"php": "^7.2 || ^8.0",
17-
"cakephp/chronos": "^1.2 || ^2.0"
16+
"php": "^8.1",
17+
"cakephp/chronos": "^2 || ^3"
1818
},
1919
"require-dev": {
2020
"friendsofphp/php-cs-fixer": "^3",
21-
"overtrue/phplint": "^2.3",
2221
"phpstan/phpstan": "^1",
23-
"phpunit/phpunit": "^7 || ^8 || ^9",
24-
"squizlabs/php_codesniffer": "^3.5"
22+
"phpunit/phpunit": "^10",
23+
"squizlabs/php_codesniffer": "^3"
2524
},
2625
"autoload": {
2726
"psr-4": {
@@ -48,7 +47,6 @@
4847
"sniffer:check": "phpcs --standard=phpcs.xml",
4948
"sniffer:fix": "phpcbf --standard=phpcs.xml",
5049
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
51-
"start": "php -S localhost:8080 -t public/",
5250
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
5351
"test:all": [
5452
"@cs:check",

phpunit.xml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
bootstrap="vendor/autoload.php"
44
colors="true"
55
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
8-
<coverage processUncoveredFiles="false">
6+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
7+
cacheDirectory=".phpunit.cache"
8+
backupStaticProperties="false">
9+
<coverage/>
10+
<testsuites>
11+
<testsuite name="Tests">
12+
<directory suffix="Test.php">tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<source>
916
<include>
1017
<directory suffix=".php">src</directory>
1118
</include>
1219
<exclude>
1320
<directory>vendor</directory>
1421
<directory>build</directory>
1522
</exclude>
16-
</coverage>
17-
<testsuites>
18-
<testsuite name="Tests">
19-
<directory suffix="Test.php">tests</directory>
20-
</testsuite>
21-
</testsuites>
23+
</source>
2224
</phpunit>

phpunit8.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/ConfigurationTest.php

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* Test.
1212
*/
13-
class ConfigurationTest extends TestCase
13+
final class ConfigurationTest extends TestCase
1414
{
1515
/**
1616
* Test.
@@ -34,9 +34,9 @@ public function testGetString($data, string $key, $default, $expected): void
3434
/**
3535
* Provider.
3636
*
37-
* @return array<array<mixed>> The test data
37+
* @return array The test data
3838
*/
39-
public function providerGetString(): array
39+
public static function providerGetString(): array
4040
{
4141
return [
4242
[['key' => 'value'], 'key', null, 'value'],
@@ -63,16 +63,14 @@ public function testGetStringError($data, string $key): void
6363

6464
$reader = new Configuration($data);
6565
$reader->getString($key);
66-
67-
$this->assertTrue(true);
6866
}
6967

7068
/**
7169
* Provider.
7270
*
73-
* @return array<array<mixed>> The test data
71+
* @return array The test data
7472
*/
75-
public function providerGetStringError(): array
73+
public static function providerGetStringError(): array
7674
{
7775
return [
7876
[['key' => 'value'], 'nope'],
@@ -103,9 +101,9 @@ public function testFindString($data, string $key, $default, $expected): void
103101
/**
104102
* Provider.
105103
*
106-
* @return array<array<mixed>> The test data
104+
* @return array The test data
107105
*/
108-
public function providerFindString(): array
106+
public static function providerFindString(): array
109107
{
110108
return [
111109
[['key' => 'value'], 'key', null, 'value'],
@@ -139,9 +137,9 @@ public function testGetInt($data, string $key, $default, $expected): void
139137
/**
140138
* Provider.
141139
*
142-
* @return array<array<mixed>> The test data
140+
* @return array The test data
143141
*/
144-
public function providerGetInt(): array
142+
public static function providerGetInt(): array
145143
{
146144
return [
147145
[['key' => 123456], 'key', null, 123456],
@@ -175,9 +173,9 @@ public function testGetIntError($data, string $key): void
175173
/**
176174
* Provider.
177175
*
178-
* @return array<array<mixed>> The test data
176+
* @return array The test data
179177
*/
180-
public function providerGetIntError(): array
178+
public static function providerGetIntError(): array
181179
{
182180
return [
183181
[['key' => 123456], 'nope'],
@@ -208,9 +206,9 @@ public function testFindInt($data, string $key, $default, $expected): void
208206
/**
209207
* Provider.
210208
*
211-
* @return array<array<mixed>> The test data
209+
* @return array The test data
212210
*/
213-
public function providerFindInt(): array
211+
public static function providerFindInt(): array
214212
{
215213
return [
216214
[['key' => 123456], 'key', null, 123456],
@@ -244,9 +242,9 @@ public function testGetBool($data, string $key, $default, $expected): void
244242
/**
245243
* Provider.
246244
*
247-
* @return array<array<mixed>> The test data
245+
* @return array The test data
248246
*/
249-
public function providerGetBool(): array
247+
public static function providerGetBool(): array
250248
{
251249
return [
252250
[['key' => true], 'key', null, true],
@@ -280,9 +278,9 @@ public function testGetBoolError($data, string $key): void
280278
/**
281279
* Provider.
282280
*
283-
* @return array<array<mixed>> The test data
281+
* @return array The test data
284282
*/
285-
public function providerGetBoolError(): array
283+
public static function providerGetBoolError(): array
286284
{
287285
return [
288286
[['key' => true], 'nope'],
@@ -313,9 +311,9 @@ public function testFindBool($data, string $key, $default, $expected): void
313311
/**
314312
* Provider.
315313
*
316-
* @return array<array<mixed>> The test data
314+
* @return array The test data
317315
*/
318-
public function providerFindBool(): array
316+
public static function providerFindBool(): array
319317
{
320318
return [
321319
[['key' => true], 'key', null, true],
@@ -349,9 +347,9 @@ public function testGetFloat($data, string $key, $default, $expected): void
349347
/**
350348
* Provider.
351349
*
352-
* @return array<array<mixed>> The test data
350+
* @return array The test data
353351
*/
354-
public function providerGetFloat(): array
352+
public static function providerGetFloat(): array
355353
{
356354
return [
357355
[['key' => 123.456], 'key', null, 123.456],
@@ -385,9 +383,9 @@ public function testGetFloatError($data, string $key): void
385383
/**
386384
* Provider.
387385
*
388-
* @return array<array<mixed>> The test data
386+
* @return array The test data
389387
*/
390-
public function providerGetFloatError(): array
388+
public static function providerGetFloatError(): array
391389
{
392390
return [
393391
[['key' => 123.456], 'nope'],
@@ -418,9 +416,9 @@ public function testFindFloat($data, string $key, $default, $expected): void
418416
/**
419417
* Provider.
420418
*
421-
* @return array<array<mixed>> The test data
419+
* @return array The test data
422420
*/
423-
public function providerFindFloat(): array
421+
public static function providerFindFloat(): array
424422
{
425423
return [
426424
[['key' => 123.456], 'key', null, 123.456],
@@ -454,9 +452,9 @@ public function testGetArray($data, string $key, $default, $expected): void
454452
/**
455453
* Provider.
456454
*
457-
* @return array<array<mixed>> The test data
455+
* @return array The test data
458456
*/
459-
public function providerGetArray(): array
457+
public static function providerGetArray(): array
460458
{
461459
return [
462460
[['key' => ['key' => 'value']], 'key', null, ['key' => 'value']],
@@ -490,9 +488,9 @@ public function testGetArrayError($data, string $key): void
490488
/**
491489
* Provider.
492490
*
493-
* @return array<array<mixed>> The test data
491+
* @return array The test data
494492
*/
495-
public function providerGetArrayError(): array
493+
public static function providerGetArrayError(): array
496494
{
497495
return [
498496
[['key' => ['key' => 'value']], 'nope'],
@@ -523,9 +521,9 @@ public function testFindArray($data, string $key, $default, $expected): void
523521
/**
524522
* Provider.
525523
*
526-
* @return array<array<mixed>> The test data
524+
* @return array The test data
527525
*/
528-
public function providerFindArray(): array
526+
public static function providerFindArray(): array
529527
{
530528
return [
531529
[['key' => ['key' => 'value']], 'key', null, ['key' => 'value']],
@@ -559,9 +557,9 @@ public function testGetChronos($data, string $key, $default, $expected): void
559557
/**
560558
* Provider.
561559
*
562-
* @return array<array<mixed>> The test data
560+
* @return array The test data
563561
*/
564-
public function providerGetChronos(): array
562+
public static function providerGetChronos(): array
565563
{
566564
return [
567565
[['key' => Chronos::now()], 'key', null, Chronos::now()],
@@ -596,9 +594,9 @@ public function testGetChronosError($data, string $key): void
596594
/**
597595
* Provider.
598596
*
599-
* @return array<array<mixed>> The test data
597+
* @return array The test data
600598
*/
601-
public function providerGetChronosError(): array
599+
public static function providerGetChronosError(): array
602600
{
603601
return [
604602
[['key' => Chronos::now()], 'nope'],
@@ -629,9 +627,9 @@ public function testFindChronos($data, string $key, $default, $expected): void
629627
/**
630628
* Provider.
631629
*
632-
* @return array<array<mixed>> The test data
630+
* @return array The test data
633631
*/
634-
public function providerFindChronos(): array
632+
public static function providerFindChronos(): array
635633
{
636634
return [
637635
[['key' => Chronos::now()], 'key', null, Chronos::now()],
@@ -647,9 +645,9 @@ public function providerFindChronos(): array
647645
/**
648646
* Provider.
649647
*
650-
* @return array<array<mixed>> The test data
648+
* @return array The test data
651649
*/
652-
public function providerAll(): array
650+
public static function providerAll(): array
653651
{
654652
return [
655653
[['key' => Chronos::now()]],

0 commit comments

Comments
 (0)