From 0a70aa53672853c4f49535b8093b1ec30887e66c Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 2 Mar 2026 15:24:24 +0100 Subject: [PATCH 1/5] add PHP 8.5, drop PHP 8.1 --- .github/workflows/build.yml | 2 +- README.md | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4bf3d5..4c3d3a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: operating-system: [ ubuntu-latest ] - php-versions: [ '8.1', '8.2' ] + php-versions: [ '8.2', '8.3', '8.4', '8.5' ] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: diff --git a/README.md b/README.md index 052e960..6fca05f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ A strictly typed configuration component for PHP. Inspired by [Apache Commons Co ## Requirements -* PHP 8.1 - 8.4 +* PHP 8.2 - 8.5 ## Installation diff --git a/composer.json b/composer.json index 85d933b..ae1030d 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "homepage": "https://github.com/selective-php/config", "require": { - "php": "8.1.* || 8.2.* || 8.3.* || 8.4.*", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", "cakephp/chronos": "^2 || ^3" }, "require-dev": { From 259eafa03746ce77113077b1bcba15f3d08d09a7 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 2 Mar 2026 15:25:16 +0100 Subject: [PATCH 2/5] update license year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index bfcf021..2013f40 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2025 odan +Copyright (c) 2026 odan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From f3c396fa32fffcff4d796e50a5057ef92a548db8 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 2 Mar 2026 15:41:55 +0100 Subject: [PATCH 3/5] Upgrade of PHPUnit from ^10 to ^11 and update test --- composer.json | 2 +- phpunit.xml | 2 +- tests/ConfigurationTest.php | 58 +++++++++++++------------------------ 3 files changed, 22 insertions(+), 40 deletions(-) diff --git a/composer.json b/composer.json index ae1030d..113aa8d 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3", "phpstan/phpstan": "^1 || ^2", - "phpunit/phpunit": "^10", + "phpunit/phpunit": "^11", "squizlabs/php_codesniffer": "^3" }, "autoload": { diff --git a/phpunit.xml b/phpunit.xml index 2927473..7b7ad74 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -3,7 +3,7 @@ bootstrap="vendor/autoload.php" colors="true" backupGlobals="false" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false"> diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php index aa239b8..db56284 100644 --- a/tests/ConfigurationTest.php +++ b/tests/ConfigurationTest.php @@ -4,6 +4,7 @@ use Cake\Chronos\Chronos; use InvalidArgumentException; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Selective\Config\Configuration; @@ -15,8 +16,6 @@ final class ConfigurationTest extends TestCase /** * Test. * - * @dataProvider providerGetString - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -24,6 +23,7 @@ final class ConfigurationTest extends TestCase * * @return void */ + #[DataProvider('providerGetString')] public function testGetString($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -50,13 +50,12 @@ public static function providerGetString(): array /** * Test. * - * @dataProvider providerGetStringError - * * @param mixed $data The data * @param string $key The lookup key * * @return void */ + #[DataProvider('providerGetStringError')] public function testGetStringError($data, string $key): void { $this->expectException(InvalidArgumentException::class); @@ -83,8 +82,6 @@ public static function providerGetStringError(): array /** * Test. * - * @dataProvider providerFindString - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -92,6 +89,7 @@ public static function providerGetStringError(): array * * @return void */ + #[DataProvider('providerFindString')] public function testFindString($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -118,8 +116,6 @@ public static function providerFindString(): array /** * Test. * - * @dataProvider providerGetInt - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -127,6 +123,7 @@ public static function providerFindString(): array * * @return void */ + #[DataProvider('providerGetInt')] public function testGetInt($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -153,13 +150,12 @@ public static function providerGetInt(): array /** * Test. * - * @dataProvider providerGetIntError - * * @param mixed $data The data * @param string $key The lookup key * * @return void */ + #[DataProvider('providerGetIntError')] public function testGetIntError($data, string $key): void { $this->expectException(InvalidArgumentException::class); @@ -188,8 +184,6 @@ public static function providerGetIntError(): array /** * Test. * - * @dataProvider providerFindInt - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -197,6 +191,7 @@ public static function providerGetIntError(): array * * @return void */ + #[DataProvider('providerFindInt')] public function testFindInt($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -223,8 +218,6 @@ public static function providerFindInt(): array /** * Test. * - * @dataProvider providerGetBool - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -232,6 +225,7 @@ public static function providerFindInt(): array * * @return void */ + #[DataProvider('providerGetBool')] public function testGetBool($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -258,13 +252,12 @@ public static function providerGetBool(): array /** * Test. * - * @dataProvider providerGetBoolError - * * @param mixed $data The data * @param string $key The lookup key * * @return void */ + #[DataProvider('providerGetBoolError')] public function testGetBoolError($data, string $key): void { $this->expectException(InvalidArgumentException::class); @@ -293,8 +286,6 @@ public static function providerGetBoolError(): array /** * Test. * - * @dataProvider providerFindBool - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -302,6 +293,7 @@ public static function providerGetBoolError(): array * * @return void */ + #[DataProvider('providerFindBool')] public function testFindBool($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -328,8 +320,6 @@ public static function providerFindBool(): array /** * Test. * - * @dataProvider providerGetFloat - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -337,6 +327,7 @@ public static function providerFindBool(): array * * @return void */ + #[DataProvider('providerGetFloat')] public function testGetFloat($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -363,13 +354,12 @@ public static function providerGetFloat(): array /** * Test. * - * @dataProvider providerGetFloatError - * * @param mixed $data The data * @param string $key The lookup key * * @return void */ + #[DataProvider('providerGetFloatError')] public function testGetFloatError($data, string $key): void { $this->expectException(InvalidArgumentException::class); @@ -398,8 +388,6 @@ public static function providerGetFloatError(): array /** * Test. * - * @dataProvider providerFindFloat - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -407,6 +395,7 @@ public static function providerGetFloatError(): array * * @return void */ + #[DataProvider('providerFindFloat')] public function testFindFloat($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -433,8 +422,6 @@ public static function providerFindFloat(): array /** * Test. * - * @dataProvider providerGetArray - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -442,6 +429,7 @@ public static function providerFindFloat(): array * * @return void */ + #[DataProvider('providerGetArray')] public function testGetArray($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -468,13 +456,12 @@ public static function providerGetArray(): array /** * Test. * - * @dataProvider providerGetArrayError - * * @param mixed $data The data * @param string $key The lookup key * * @return void */ + #[DataProvider('providerGetArrayError')] public function testGetArrayError($data, string $key): void { $this->expectException(InvalidArgumentException::class); @@ -503,8 +490,6 @@ public static function providerGetArrayError(): array /** * Test. * - * @dataProvider providerFindArray - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -512,6 +497,7 @@ public static function providerGetArrayError(): array * * @return void */ + #[DataProvider('providerFindArray')] public function testFindArray($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -538,8 +524,6 @@ public static function providerFindArray(): array /** * Test. * - * @dataProvider providerGetChronos - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -547,6 +531,7 @@ public static function providerFindArray(): array * * @return void */ + #[DataProvider('providerGetChronos')] public function testGetChronos($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -574,13 +559,12 @@ public static function providerGetChronos(): array /** * Test. * - * @dataProvider providerGetChronosError - * * @param mixed $data The data * @param string $key The lookup key * * @return void */ + #[DataProvider('providerGetChronosError')] public function testGetChronosError($data, string $key): void { $this->expectException(InvalidArgumentException::class); @@ -609,8 +593,6 @@ public static function providerGetChronosError(): array /** * Test. * - * @dataProvider providerFindChronos - * * @param mixed $data The data * @param string $key The lookup key * @param mixed $default The default value @@ -618,6 +600,7 @@ public static function providerGetChronosError(): array * * @return void */ + #[DataProvider('providerFindChronos')] public function testFindChronos($data, string $key, $default, $expected): void { $reader = new Configuration($data); @@ -664,12 +647,11 @@ public static function providerAll(): array /** * Test. * - * @dataProvider providerAll - * * @param mixed $data The data * * @return void */ + #[DataProvider('providerAll')] public function testAll($data): void { $reader = new Configuration($data); From 6b0100da08b4eefd4555d71df3270e0ae90bd9e8 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 2 Mar 2026 15:43:14 +0100 Subject: [PATCH 4/5] remove scrutinizer --- .scrutinizer.yml | 41 ----------------------------------------- README.md | 2 -- 2 files changed, 43 deletions(-) delete mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 3514e2e..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,41 +0,0 @@ -filter: - paths: [ "src/*" ] - excluded_paths: [ "vendor/*", "tests/*" ] - -checks: - php: - code_rating: true - duplication: true - -tools: - external_code_coverage: false - -build: - environment: - php: - version: 8.1.2 - ini: - xdebug.mode: coverage - mysql: false - node: false - postgresql: false - mongodb: false - elasticsearch: false - redis: false - memcached: false - neo4j: false - rabbitmq: false - nodes: - analysis: - tests: - override: - - php-scrutinizer-run - dependencies: - before: - - composer self-update - tests: - before: - - command: composer test:coverage - coverage: - file: 'build/logs/clover.xml' - format: 'clover' diff --git a/README.md b/README.md index 6fca05f..b450ac1 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ A strictly typed configuration component for PHP. Inspired by [Apache Commons Co [![Latest Version on Packagist](https://img.shields.io/github/release/selective-php/config.svg)](https://packagist.org/packages/selective/config) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) [![Build Status](https://github.com/selective-php/config/workflows/build/badge.svg)](https://github.com/selective-php/config/actions) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/selective-php/config.svg)](https://scrutinizer-ci.com/g/selective-php/config/code-structure) -[![Quality Score](https://img.shields.io/scrutinizer/quality/g/selective-php/config.svg)](https://scrutinizer-ci.com/g/selective-php/config/?branch=master) [![Total Downloads](https://img.shields.io/packagist/dt/selective/config.svg)](https://packagist.org/packages/selective/config/stats) From 44de4d5249d291878e4927f2c919da36b6fa8fb1 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 2 Mar 2026 15:45:49 +0100 Subject: [PATCH 5/5] fixed PHP_CS_FIXER_IGNORE_ENV deprecation --- composer.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 113aa8d..eeb6603 100644 --- a/composer.json +++ b/composer.json @@ -37,12 +37,10 @@ }, "scripts": { "cs:check": [ - "@putenv PHP_CS_FIXER_IGNORE_ENV=1", - "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi" + "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi --allow-unsupported-php-version=yes" ], "cs:fix": [ - "@putenv PHP_CS_FIXER_IGNORE_ENV=1", - "php-cs-fixer fix --config=.cs.php --ansi --verbose" + "php-cs-fixer fix --config=.cs.php --ansi --verbose --allow-unsupported-php-version=yes" ], "sniffer:check": "phpcs --standard=phpcs.xml", "sniffer:fix": "phpcbf --standard=phpcs.xml",