diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ee80a52..185147b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,12 +16,17 @@ jobs: cs: uses: bedita/github-workflows/.github/workflows/php-cs.yml@v2 with: - php_versions: '["8.3"]' + php_versions: '["8.5"]' + + psalm: + uses: bedita/github-workflows/.github/workflows/php-psalm.yml@v2 + with: + php_versions: '["8.5"]' stan: uses: bedita/github-workflows/.github/workflows/php-stan.yml@v2 with: - php_versions: '["8.3"]' + php_versions: '["8.5"]' unit: name: 'Run unit tests' @@ -30,7 +35,7 @@ jobs: strategy: matrix: - php-version: [8.3] + php-version: [8.3, 8.4, 8.5] steps: - name: 'Checkout current revision' diff --git a/.scrutinizer.yml b/.scrutinizer.yml index d10f5c8..43d19a8 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -22,7 +22,7 @@ build: analysis: environment: php: - version: 8.3.3 + version: 8.3.16 tests: override: - php-scrutinizer-run diff --git a/README.md b/README.md index 8c71b6d..6fafdcc 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Github Actions](https://github.com/bedita/dev-tools/workflows/php/badge.svg)](https://github.com/bedita/dev-tools/actions?query=workflow%3Aphp) [![codecov](https://codecov.io/gh/bedita/dev-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/bedita/dev-tools) [![phpstan](https://img.shields.io/badge/PHPStan-level%209-brightgreen.svg)](https://phpstan.org) +[![psalm](https://img.shields.io/badge/psalm-level%208-brightgreen.svg)](https://psalm.dev) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bedita/dev-tools/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/bedita/dev-tools/?branch=master) [![image](https://img.shields.io/packagist/v/bedita/dev-tools.svg?label=stable)](https://packagist.org/packages/bedita/dev-tools) [![image](https://img.shields.io/github/license/bedita/dev-tools.svg)](https://github.com/bedita/dev-tools/blob/master/LICENSE.LGPL) diff --git a/composer.json b/composer.json index 5e79480..f1eaa72 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,8 @@ "phpstan/phpstan": "^1.10", "phpstan/extension-installer": "^1.0", "phpstan/phpstan-deprecation-rules": "^1.0", - "phpunit/phpunit": "^11.5 || ^12.1" + "phpunit/phpunit": "^11.5 || ^12.1", + "vimeo/psalm": "^6.8" }, "autoload": { "psr-4": { @@ -54,6 +55,7 @@ ], "cs-check": "vendor/bin/phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests", "cs-fix": "vendor/bin/phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests", + "psalm": "vendor/bin/psalm", "stan": "vendor/bin/phpstan analyse", "test": "vendor/bin/phpunit --colors=always", "coverage": "vendor/bin/phpunit --colors=always --coverage-html coverage" diff --git a/psalm.xml.dist b/psalm.xml.dist new file mode 100644 index 0000000..47e667f --- /dev/null +++ b/psalm.xml.dist @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/tests/TestCase/Command/ChangeLogCommandTest.php b/tests/TestCase/Command/ChangeLogCommandTest.php index 6043956..c7e8a1e 100644 --- a/tests/TestCase/Command/ChangeLogCommandTest.php +++ b/tests/TestCase/Command/ChangeLogCommandTest.php @@ -22,21 +22,11 @@ use Cake\Routing\Router; use Cake\TestSuite\TestCase; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\CoversMethod; /** * {@see BEdita\DevTools\Command\ChangeLogCommand} Test Case */ #[CoversClass(ChangeLogCommand::class)] -#[CoversMethod(ChangeLogCommand::class, 'buildOptionParser')] -#[CoversMethod(ChangeLogCommand::class, 'classify')] -#[CoversMethod(ChangeLogCommand::class, 'createChangeLog')] -#[CoversMethod(ChangeLogCommand::class, 'execute')] -#[CoversMethod(ChangeLogCommand::class, 'fetchPrs')] -#[CoversMethod(ChangeLogCommand::class, 'filterItems')] -#[CoversMethod(ChangeLogCommand::class, 'initialize')] -#[CoversMethod(ChangeLogCommand::class, 'loglines')] -#[CoversMethod(ChangeLogCommand::class, 'saveChangeLog')] class ChangeLogCommandTest extends TestCase { use ConsoleIntegrationTestTrait; diff --git a/tests/TestCase/Command/ResourcesMigrationCommandTest.php b/tests/TestCase/Command/ResourcesMigrationCommandTest.php index 76f8f9f..9176fd9 100644 --- a/tests/TestCase/Command/ResourcesMigrationCommandTest.php +++ b/tests/TestCase/Command/ResourcesMigrationCommandTest.php @@ -22,17 +22,11 @@ use Cake\TestSuite\StringCompareTrait; use Cake\TestSuite\TestCase; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\CoversMethod; /** * Test resources migration task */ #[CoversClass(ResourcesMigrationCommand::class)] -#[CoversMethod(ResourcesMigrationCommand::class, 'bake')] -#[CoversMethod(ResourcesMigrationCommand::class, 'buildOptionParser')] -#[CoversMethod(ResourcesMigrationCommand::class, 'fileName')] -#[CoversMethod(ResourcesMigrationCommand::class, 'name')] -#[CoversMethod(ResourcesMigrationCommand::class, 'template')] class ResourcesMigrationCommandTest extends TestCase { use ConsoleIntegrationTestTrait; diff --git a/tests/TestCase/DevToolsPluginTest.php b/tests/TestCase/DevToolsPluginTest.php index b72318f..7638bb4 100644 --- a/tests/TestCase/DevToolsPluginTest.php +++ b/tests/TestCase/DevToolsPluginTest.php @@ -24,7 +24,6 @@ use Cake\Http\ServerRequest; use Cake\Routing\Middleware\AssetMiddleware; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\CoversMethod; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; @@ -32,8 +31,6 @@ * Test {@see \BEdita\DevTools\DevToolsPlugin}. */ #[CoversClass(DevToolsPlugin::class)] -#[CoversMethod(DevToolsPlugin::class, 'bootstrap')] -#[CoversMethod(DevToolsPlugin::class, 'middleware')] class DevToolsPluginTest extends TestCase { /**