From 0910c20bd87ff91b66fe8eb0196da7ee4f1b00e5 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 25 Oct 2026 18:54:53 +0300 Subject: [PATCH] Replace Psalm to PHPStan --- .github/workflows/static.yml | 6 +++--- composer.json | 11 ++--------- docs/internals.md | 4 ++-- phpstan.neon | 4 ++++ psalm.xml | 15 --------------- tools/.gitignore | 2 -- tools/psalm/composer.json | 5 ----- 7 files changed, 11 insertions(+), 36 deletions(-) create mode 100644 phpstan.neon delete mode 100644 psalm.xml delete mode 100644 tools/.gitignore delete mode 100644 tools/psalm/composer.json diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index d53a0db..ddb595c 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -4,7 +4,7 @@ on: pull_request: paths: &paths - 'src/**' - - 'psalm.xml' + - 'phpstan.neon' - 'composer.json' - '.github/workflows/static.yml' @@ -20,8 +20,8 @@ concurrency: cancel-in-progress: true jobs: - psalm: - uses: yiisoft/actions/.github/workflows/psalm.yml@master + phpstan: + uses: yiisoft/actions/.github/workflows/phpstan.yml@master with: os: >- ['ubuntu-latest'] diff --git a/composer.json b/composer.json index 4fe78e6..1fc6697 100644 --- a/composer.json +++ b/composer.json @@ -44,27 +44,20 @@ "config": { "sort-packages": true, "allow-plugins": { - "bamarni/composer-bin-plugin": true, "composer/package-versions-deprecated": true } }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.3", "friendsofphp/php-cs-fixer": "^3.92", + "phpstan/phpstan": "^2.3", "phpunit/phpunit": "^9.6.22", "rector/rector": "^2.3", "shipmonk/composer-dependency-analyser": "^1.8", "spatie/phpunit-watcher": "^1.23.6" }, - "extra": { - "bamarni-bin": { - "bin-links": true, - "target-directory": "tools", - "forward-command": true - } - }, "scripts": { "dependency-analyser": "composer-dependency-analyser", + "phpstan": "phpstan", "test": "phpunit --testdox --no-interaction", "test-watch": "phpunit-watcher watch" } diff --git a/docs/internals.md b/docs/internals.md index 304fe84..b9f9d19 100644 --- a/docs/internals.md +++ b/docs/internals.md @@ -10,10 +10,10 @@ The package is tested with [PHPUnit](https://phpunit.de/). To run tests: ## Static analysis -The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: +The code is statically analyzed with [PHPStan](https://phpstan.org/). To run static analysis: ```shell -./vendor/bin/psalm +./vendor/bin/phpstan ``` ## Dependencies diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..776ccd8 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,4 @@ +parameters: + level: max + paths: + - src diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 3240886..0000000 --- a/psalm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index cf452dc..0000000 --- a/tools/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/*/vendor -/*/composer.lock diff --git a/tools/psalm/composer.json b/tools/psalm/composer.json deleted file mode 100644 index 4b37abf..0000000 --- a/tools/psalm/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require-dev": { - "vimeo/psalm": "^4.30 || ^5.26.1 || ^6.8.8" - } -}