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/.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/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 diff --git a/README.md b/README.md index 052e960..b450ac1 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,12 @@ 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) ## Requirements -* PHP 8.1 - 8.4 +* PHP 8.2 - 8.5 ## Installation diff --git a/composer.json b/composer.json index 85d933b..eeb6603 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,13 @@ ], "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": { "friendsofphp/php-cs-fixer": "^3", "phpstan/phpstan": "^1 || ^2", - "phpunit/phpunit": "^10", + "phpunit/phpunit": "^11", "squizlabs/php_codesniffer": "^3" }, "autoload": { @@ -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", 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);