Skip to content

Commit 27fae4e

Browse files
committed
Use psalm instead of phpstan
1 parent 5b8d9f9 commit 27fae4e

File tree

5 files changed

+32
-28
lines changed

5 files changed

+32
-28
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,29 @@ jobs:
88

99
steps:
1010
- uses: actions/checkout@v2
11-
- uses: shivammathur/setup-php@v1
11+
- uses: shivammathur/setup-php@2.3.1
1212
with:
1313
php-version: 7.3
1414
coverage: pcov
1515

16+
- name: Setup problem matcher for PHPUnit
17+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
18+
1619
- name: Install dependencies
1720
run: composer install
1821

1922
- name: Run PHPUnit
2023
run: vendor/bin/phpunit --coverage-clover=coverage.xml
2124

2225
- name: Upload coverage to Codecov
23-
uses: codecov/codecov-action@v1
26+
uses: codecov/codecov-action@v1.0.7
2427

2528
phpcs:
2629
runs-on: ubuntu-latest
2730

2831
steps:
2932
- uses: actions/checkout@v2
30-
- uses: shivammathur/setup-php@v1
33+
- uses: shivammathur/setup-php@2.3.1
3134
with:
3235
php-version: 7.3
3336
coverage: none
@@ -39,19 +42,18 @@ jobs:
3942
- name: Run PHP Codesniffer
4043
run: vendor/bin/phpcs --report=checkstyle -q | cs2pr --graceful-warnings
4144

42-
phpstan:
45+
psalm:
4346
runs-on: ubuntu-latest
4447

4548
steps:
4649
- uses: actions/checkout@v2
47-
- uses: shivammathur/setup-php@v1
50+
- uses: shivammathur/setup-php@2.3.1
4851
with:
4952
php-version: 7.3
5053
coverage: none
51-
tools: cs2pr
5254

5355
- name: Install dependencies
5456
run: composer install
5557

56-
- name: Run PHPStan
57-
run: vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr
58+
- name: Run Psalm
59+
run: vendor/bin/psalm --output-format=github

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
"ext-json": "*"
1515
},
1616
"require-dev": {
17+
"phpunit/phpunit": "^9.0",
1718
"squizlabs/php_codesniffer": "^3.5",
18-
"phpstan/phpstan": "^0.12.25",
19-
"phpstan/phpstan-deprecation-rules": "^0.12.3",
20-
"phpunit/phpunit": "^9.1"
19+
"vimeo/psalm": "^3.12"
2120
},
2221
"autoload": {
2322
"psr-4": {
@@ -28,5 +27,8 @@
2827
"psr-4": {
2928
"MichehTest\\PhpCodeSniffer\\": "tests/"
3029
}
30+
},
31+
"config": {
32+
"sort-packages": true
3133
}
3234
}

phpstan.neon.dist

Lines changed: 0 additions & 12 deletions
This file was deleted.

psalm.xml.dist

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<psalm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="https://getpsalm.org/schema/config"
4+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
5+
autoloader="vendor/squizlabs/php_codesniffer/autoload.php"
6+
errorLevel="2"
7+
resolveFromConfigFile="true"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
12+
<ignoreFiles>
13+
<directory name="vendor" />
14+
</ignoreFiles>
15+
</projectFiles>
16+
</psalm>

src/Report/Gitlab.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
class Gitlab implements Report
2222
{
2323
/**
24-
* @param File $phpcsFile
25-
* @inheritDoc
24+
* @psalm-suppress ImplementedParamTypeMismatch PHP_CodeSniffer has a wrong docblock
2625
*/
2726
public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80): bool
2827
{
@@ -55,9 +54,6 @@ public function generateFileReport($report, File $phpcsFile, $showSources = fals
5554
return $hasOutput;
5655
}
5756

58-
/**
59-
* @inheritDoc
60-
*/
6157
public function generate(
6258
$cachedData,
6359
$totalFiles,

0 commit comments

Comments
 (0)