diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b88998f..429673a 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', '8.3', '8.4' ] + 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 7864492..0ad9d6c 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ the [notification pattern](https://martinfowler.com/articles/replaceThrowWithNot ## Requirements -* PHP 8.1 - 8.4 +* PHP 8.2 - 8.5 ## Installation diff --git a/composer.json b/composer.json index 2d9114c..c9f9474 100644 --- a/composer.json +++ b/composer.json @@ -11,19 +11,19 @@ "psr15" ], "require": { - "php": "8.1.* || 8.2.* || 8.3.* || 8.4.*", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", "ext-json": "*", - "psr/http-factory": "^1.0.1", + "psr/http-factory": "^1.1.0", "psr/http-server-middleware": "^1.0.1" }, "require-dev": { - "cakephp/validation": "^4.2", + "cakephp/validation": "^5.3", "fig/http-message-util": "^1.1", "friendsofphp/php-cs-fixer": "^3", "nyholm/psr7": "^1.4", - "phpstan/phpstan": "^1 || ^2", - "phpunit/phpunit": "^10", - "relay/relay": "^2.0", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^11", + "relay/relay": "^3.0", "slim/psr7": "^1", "squizlabs/php_codesniffer": "^3" }, @@ -43,12 +43,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/Encoder/JsonEncoderTest.php b/tests/Encoder/JsonEncoderTest.php index e60ec1c..811fdb9 100644 --- a/tests/Encoder/JsonEncoderTest.php +++ b/tests/Encoder/JsonEncoderTest.php @@ -2,15 +2,15 @@ namespace Selective\Validation\Test\Encoder; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Selective\Validation\Encoder\JsonEncoder; use UnexpectedValueException; /** * Tests. - * - * @coversDefaultClass \Selective\Validation\Encoder\JsonEncoder */ +#[CoversClass(JsonEncoder::class)] class JsonEncoderTest extends TestCase { /** diff --git a/tests/Exception/ValidationExceptionTest.php b/tests/Exception/ValidationExceptionTest.php index 2163ac3..b5ad6bf 100644 --- a/tests/Exception/ValidationExceptionTest.php +++ b/tests/Exception/ValidationExceptionTest.php @@ -2,15 +2,15 @@ namespace Selective\Validation\Test\Exception; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Selective\Validation\Exception\ValidationException; use Selective\Validation\Test\TestService; /** * Tests. - * - * @coversDefaultClass \Selective\Validation\Exception\ValidationException */ +#[CoversClass(ValidationException::class)] class ValidationExceptionTest extends TestCase { /** diff --git a/tests/Middleware/ValidationExceptionMiddlewareTest.php b/tests/Middleware/ValidationExceptionMiddlewareTest.php index c099c79..a271f54 100644 --- a/tests/Middleware/ValidationExceptionMiddlewareTest.php +++ b/tests/Middleware/ValidationExceptionMiddlewareTest.php @@ -4,6 +4,7 @@ use Fig\Http\Message\StatusCodeInterface; use Nyholm\Psr7\Factory\Psr17Factory; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Selective\Validation\Encoder\JsonEncoder; use Selective\Validation\Middleware\ValidationExceptionMiddleware; @@ -11,9 +12,8 @@ /** * Tests. - * - * @coversDefaultClass \Selective\Validation\Middleware\ValidationExceptionMiddleware */ +#[CoversClass(ValidationExceptionMiddleware::class)] class ValidationExceptionMiddlewareTest extends TestCase { use MiddlewareTestTrait; diff --git a/tests/Transformer/ErrorDetailsTransformerTest.php b/tests/Transformer/ErrorDetailsTransformerTest.php index 2df6aa7..be18db8 100644 --- a/tests/Transformer/ErrorDetailsTransformerTest.php +++ b/tests/Transformer/ErrorDetailsTransformerTest.php @@ -2,15 +2,15 @@ namespace Selective\Validation\Test\Transformer; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Selective\Validation\Transformer\ErrorDetailsResultTransformer; use Selective\Validation\ValidationResult; /** * Tests. - * - * @coversDefaultClass \Selective\Validation\Transformer\ErrorDetailsResultTransformer */ +#[CoversClass(ErrorDetailsResultTransformer::class)] class ErrorDetailsTransformerTest extends TestCase { /** diff --git a/tests/ValidationErrorTest.php b/tests/ValidationErrorTest.php index ad958fd..8ea6976 100644 --- a/tests/ValidationErrorTest.php +++ b/tests/ValidationErrorTest.php @@ -2,14 +2,14 @@ namespace Selective\Validation\Test; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Selective\Validation\ValidationError; /** * Tests. - * - * @coversDefaultClass \Selective\Validation\ValidationError */ +#[CoversClass(ValidationError::class)] class ValidationErrorTest extends TestCase { /** diff --git a/tests/ValidationResultTest.php b/tests/ValidationResultTest.php index 3f3b86c..a6ce4ca 100644 --- a/tests/ValidationResultTest.php +++ b/tests/ValidationResultTest.php @@ -2,15 +2,15 @@ namespace Selective\Validation\Test; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Selective\Validation\ValidationError; use Selective\Validation\ValidationResult; /** * ValidationResult tests. - * - * @coversDefaultClass \Selective\Validation\ValidationResult */ +#[CoversClass(ValidationResult::class)] class ValidationResultTest extends TestCase { /**