Skip to content

Commit 544c37b

Browse files
committed
remplace psalm with phpstan
Signed-off-by: sergiu <[email protected]>
1 parent db762ec commit 544c37b

File tree

10 files changed

+73
-378
lines changed

10 files changed

+73
-378
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
on:
2+
- push
3+
4+
name: Run PHPStan checks
5+
6+
jobs:
7+
mutation:
8+
name: PHPStan ${{ matrix.php }}-${{ matrix.os }}
9+
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
17+
php:
18+
- "8.2"
19+
- "8.3"
20+
- "8.4"
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Install PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: "${{ matrix.php }}"
30+
coverage: pcov
31+
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
32+
tools: composer:v2, cs2pr
33+
34+
- name: Determine composer cache directory
35+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
36+
37+
- name: Cache dependencies installed with composer
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ env.COMPOSER_CACHE_DIR }}
41+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
42+
restore-keys: |
43+
php${{ matrix.php }}-composer-
44+
- name: Install dependencies with composer
45+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
46+
47+
- name: Setup project
48+
run: |
49+
mv config/autoload/local.php.dist config/autoload/local.php
50+
mv config/autoload/mail.local.php.dist config/autoload/mail.local.php
51+
mv config/autoload/local.test.php.dist config/autoload/local.test.php
52+
- name: Run static analysis with PHPStan
53+
run: vendor/bin/phpstan analyse

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/.phpcs-cache
2-
/.psalm-cache
32
/.phpunit.cache
43
/clover.xml
54
/coveralls-upload.json

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@
5555
"require-dev": {
5656
"laminas/laminas-coding-standard": "^3.0",
5757
"phpunit/phpunit": "^10.5.45",
58-
"psalm/plugin-phpunit": "^0.19.2",
5958
"roave/security-advisories": "dev-master",
6059
"swoole/ide-helper": "~5.0.0",
61-
"vimeo/psalm": "^6.8.8"
60+
"phpstan/phpstan": "^2.0",
61+
"phpstan/phpstan-doctrine": "^2.0",
62+
"phpstan/phpstan-phpunit": "^2.0"
6263
},
6364
"autoload": {
6465
"psr-4": {
@@ -79,6 +80,6 @@
7980
"cs-fix": "phpcbf",
8081
"test": "phpunit --colors=always",
8182
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
82-
"static-analysis": "psalm --shepherd --stats"
83+
"static-analysis": "phpstan analyse"
8384
}
8485
}

phpstan.neon

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
includes:
2+
- vendor/phpstan/phpstan-doctrine/extension.neon
3+
- vendor/phpstan/phpstan-phpunit/extension.neon
4+
parameters:
5+
level: 5
6+
paths:
7+
- src
8+
- test
9+
treatPhpDocTypesAsCertain: false
10+
ignoreErrors:
11+
- '#Constant Queue\\Swoole\\Command\\StartCommand::PROGRAMMATIC_CONFIG_FILES is unused#'

0 commit comments

Comments
 (0)