diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f1c363..2d4c3ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,8 @@ name: build on: + schedule: + - cron: "0 13 * * 1" push: branches: - main @@ -16,4 +18,4 @@ jobs: slim-adapter: uses: ./.github/workflows/slim.yml with: - php-versions: '8.1,8.2,8.3,8.4' + php-versions: '8.1,8.2,8.3,8.4,8.5' diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 2cf923a..8dff5ca 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -15,11 +15,13 @@ jobs: matrix: operating-system: [ ubuntu-latest ] php: ${{ fromJson(format('[{0}]', inputs.php-versions)) }} - laravel: [ '10.0', '11.0' ] + laravel: [ '10.0', '11.0', '12.0' ] dependencies: [ 'lowest', 'highest' ] exclude: - php: '8.1' laravel: '11.0' + - php: '8.1' + laravel: '12.0' name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies diff --git a/.github/workflows/security-checks.yml b/.github/workflows/security-checks.yml index 9db4aa6..42f2e9e 100644 --- a/.github/workflows/security-checks.yml +++ b/.github/workflows/security-checks.yml @@ -15,7 +15,7 @@ jobs: fail-fast: true matrix: operating-system: [ ubuntu-latest ] - php: [ '8.1', '8.2', '8.3', '8.4' ] + php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ] dependencies: [ 'highest' ] name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies diff --git a/composer.json b/composer.json index c708488..1f4bbfc 100644 --- a/composer.json +++ b/composer.json @@ -55,12 +55,12 @@ "symfony/psr-http-message-bridge": "^6.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.47.1", + "friendsofphp/php-cs-fixer": "^3.62.0", "league/container": "^4.2", - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^1.10 || ^2.0", "phpunit/phpunit": "^10.0", "symfony/yaml": "^6.0|^7.0", - "zircote/swagger-php": "^4.8" + "zircote/swagger-php": "^4.8 || ^5.0" }, "suggest": { "laravel/laravel": "A PHP framework", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 772379b..ecacce7 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,86 +1,121 @@ parameters: ignoreErrors: - - message: "#^Call to method failSchemaMismatch\\(\\) on an unknown class Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#" + message: '#^Call to method failSchemaMismatch\(\) on an unknown class Radebatz\\OpenApi\\Verifier\\VerifiesOpenApi\.$#' + identifier: class.notFound count: 1 path: src/Adapters/Laravel/OpenApiVerifierMiddleware.php - - message: "#^Call to method verifyOpenApi\\(\\) on an unknown class Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#" + message: '#^Call to method verifyOpenApi\(\) on an unknown class Radebatz\\OpenApi\\Verifier\\VerifiesOpenApi\.$#' + identifier: class.notFound count: 1 path: src/Adapters/Laravel/OpenApiVerifierMiddleware.php - - message: "#^PHPDoc tag @var for variable \\$verifier has invalid type Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#" + message: '#^PHPDoc tag @var for variable \$verifier has invalid type Radebatz\\OpenApi\\Verifier\\VerifiesOpenApi\.$#' + identifier: varTag.trait count: 1 path: src/Adapters/Laravel/OpenApiVerifierMiddleware.php - - message: "#^Call to method failSchemaMismatch\\(\\) on an unknown class Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#" + message: '#^Call to method failSchemaMismatch\(\) on an unknown class Radebatz\\OpenApi\\Verifier\\VerifiesOpenApi\.$#' + identifier: class.notFound count: 1 path: src/Adapters/Slim/OpenApiVerifierMiddleware.php - - message: "#^Call to method verifyOpenApi\\(\\) on an unknown class Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#" + message: '#^Call to method verifyOpenApi\(\) on an unknown class Radebatz\\OpenApi\\Verifier\\VerifiesOpenApi\.$#' + identifier: class.notFound count: 1 path: src/Adapters/Slim/OpenApiVerifierMiddleware.php - - message: "#^PHPDoc tag @var for variable \\$verifier has invalid type Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#" + message: '#^PHPDoc tag @var for variable \$verifier has invalid type Radebatz\\OpenApi\\Verifier\\VerifiesOpenApi\.$#' + identifier: varTag.trait count: 1 path: src/Adapters/Slim/OpenApiVerifierMiddleware.php - - message: "#^Call to sprintf contains 2 placeholders, 1 value given\\.$#" + message: '#^Call to sprintf contains 2 placeholders, 1 value given\.$#' + identifier: argument.sprintf count: 1 path: src/OpenApiSchemaMismatchException.php - - message: "#^Access to an undefined property object\\:\\:\\$anyOf\\.$#" + message: '#^Call to function property_exists\(\) with \$this\(Radebatz\\OpenApi\\Verifier\\Tests\\Adapters\\LaravelAdapterTest\) and ''openapiSpecification'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType count: 1 - path: src/OpenApiSpecificationLoader.php + path: tests/Adapters/LaravelAdapterTest.php - - message: "#^If condition is always true\\.$#" + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue count: 1 path: tests/Adapters/LaravelAdapterTest.php - - message: "#^Negated boolean expression is always false\\.$#" + message: '#^Negated boolean expression is always false\.$#' + identifier: booleanNot.alwaysFalse count: 2 path: tests/Adapters/LaravelAdapterTest.php - - message: "#^Ternary operator condition is always false\\.$#" + message: '#^Ternary operator condition is always false\.$#' + identifier: ternary.alwaysFalse count: 1 path: tests/Adapters/LaravelAdapterTest.php - - message: "#^Access to an undefined property Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\SlimAdapterTest\\:\\:\\$app\\.$#" + message: '#^Access to an undefined property Radebatz\\OpenApi\\Verifier\\Tests\\Adapters\\SlimAdapterTest\:\:\$app\.$#' + identifier: property.notFound + count: 1 + path: tests/Adapters/SlimAdapterTest.php + + - + message: '#^Call to function property_exists\(\) with \$this\(Radebatz\\OpenApi\\Verifier\\Tests\\Adapters\\SlimAdapterTest\) and ''openapiSpecification'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType count: 1 path: tests/Adapters/SlimAdapterTest.php - - message: "#^If condition is always true\\.$#" + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue count: 1 path: tests/Adapters/SlimAdapterTest.php - - message: "#^Negated boolean expression is always false\\.$#" + message: '#^Negated boolean expression is always false\.$#' + identifier: booleanNot.alwaysFalse count: 1 path: tests/Adapters/SlimAdapterTest.php - - message: "#^Right side of \\|\\| is always false\\.$#" + message: '#^Right side of \|\| is always false\.$#' + identifier: booleanOr.rightAlwaysFalse count: 1 path: tests/Adapters/SlimAdapterTest.php - - message: "#^Ternary operator condition is always false\\.$#" + message: '#^Ternary operator condition is always false\.$#' + identifier: ternary.alwaysFalse count: 1 path: tests/Adapters/SlimAdapterTest.php - - message: "#^If condition is always true\\.$#" + message: '#^Call to function is_object\(\) with Radebatz\\OpenApi\\Verifier\\OpenApiSpecificationLoader will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: tests/OpenApiSpecificationLoaderTest.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#' + identifier: method.alreadyNarrowedType + count: 1 + path: tests/OpenApiSpecificationLoaderTest.php + + - + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue count: 1 path: tests/VerifiesOpenApiTest.php diff --git a/phpstan.neon b/phpstan.neon index ce86b23..f12cef8 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -11,4 +11,3 @@ parameters: processTimeout: 300.0 excludePaths: - 'tests/Fixtures/*' - ignoreErrors: