Skip to content

Commit e6c32b3

Browse files
committed
Switch from PHPStan to Psalm - #61
1 parent 6b869b0 commit e6c32b3

14 files changed

+5673
-126
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Check Coding Standards"
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
coding-standards:
9+
name: "Check Coding Standards"
10+
11+
runs-on: ${{ matrix.operating-system }}
12+
13+
strategy:
14+
matrix:
15+
dependencies:
16+
- "locked"
17+
php-version:
18+
- "7.4"
19+
operating-system:
20+
- "ubuntu-latest"
21+
22+
steps:
23+
- name: "Checkout"
24+
uses: "actions/checkout@v2"
25+
26+
- name: "Install PHP"
27+
uses: "shivammathur/setup-php@v2"
28+
with:
29+
coverage: "pcov"
30+
php-version: "${{ matrix.php-version }}"
31+
ini-values: memory_limit=-1
32+
tools: composer:v2
33+
34+
- name: "Cache dependencies"
35+
uses: "actions/cache@v2"
36+
with:
37+
path: |
38+
~/.composer/cache
39+
vendor
40+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
41+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
42+
43+
- name: "Install lowest dependencies"
44+
if: ${{ matrix.dependencies == 'lowest' }}
45+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
46+
47+
- name: "Install highest dependencies"
48+
if: ${{ matrix.dependencies == 'highest' }}
49+
run: "composer update --no-interaction --no-progress --no-suggest"
50+
51+
- name: "Install locked dependencies"
52+
if: ${{ matrix.dependencies == 'locked' }}
53+
run: "composer install --no-interaction --no-progress --no-suggest"
54+
55+
- name: "Coding Standard"
56+
run: "vendor/bin/php-cs-fixer fix -v --diff --dry-run"

.github/workflows/integration.yml

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

.github/workflows/phpunit.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "PHPUnit tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
phpunit:
9+
name: "PHPUnit tests"
10+
11+
runs-on: ${{ matrix.operating-system }}
12+
13+
strategy:
14+
matrix:
15+
dependencies:
16+
- "lowest"
17+
- "highest"
18+
- "locked"
19+
php-version:
20+
- "7.4"
21+
- "8.0"
22+
operating-system:
23+
- "ubuntu-latest"
24+
25+
steps:
26+
- name: "Checkout"
27+
uses: "actions/checkout@v2"
28+
29+
- name: "Install PHP"
30+
uses: "shivammathur/setup-php@v2"
31+
with:
32+
coverage: "pcov"
33+
php-version: "${{ matrix.php-version }}"
34+
ini-values: memory_limit=-1
35+
tools: composer:v2
36+
37+
- name: "Cache dependencies"
38+
uses: "actions/cache@v2"
39+
with:
40+
path: |
41+
~/.composer/cache
42+
vendor
43+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
44+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
46+
- name: "Install lowest dependencies"
47+
if: ${{ matrix.dependencies == 'lowest' }}
48+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
49+
50+
- name: "Install highest dependencies"
51+
if: ${{ matrix.dependencies == 'highest' }}
52+
run: "composer update --no-interaction --no-progress --no-suggest"
53+
54+
- name: "Install locked dependencies"
55+
if: ${{ matrix.dependencies == 'locked' }}
56+
run: "composer install --no-interaction --no-progress --no-suggest"
57+
58+
- name: "Tests"
59+
run: "vendor/bin/phpunit"

.github/workflows/psalm.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Static Analysis by Psalm"
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
static-analysis-psalm:
9+
name: "Static Analysis by Psalm"
10+
11+
runs-on: ${{ matrix.operating-system }}
12+
13+
strategy:
14+
matrix:
15+
dependencies:
16+
- "locked"
17+
php-version:
18+
- "8.0"
19+
operating-system:
20+
- "ubuntu-latest"
21+
22+
steps:
23+
- name: "Checkout"
24+
uses: "actions/checkout@v2"
25+
26+
- name: "Install PHP"
27+
uses: "shivammathur/setup-php@v2"
28+
with:
29+
coverage: "pcov"
30+
php-version: "${{ matrix.php-version }}"
31+
ini-values: memory_limit=-1
32+
tools: composer:v2, cs2pr
33+
34+
- name: "Cache dependencies"
35+
uses: "actions/cache@v2"
36+
with:
37+
path: |
38+
~/.composer/cache
39+
vendor
40+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
41+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
42+
43+
- name: "Install lowest dependencies"
44+
if: ${{ matrix.dependencies == 'lowest' }}
45+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
46+
47+
- name: "Install highest dependencies"
48+
if: ${{ matrix.dependencies == 'highest' }}
49+
run: "composer update --no-interaction --no-progress --no-suggest"
50+
51+
- name: "Install locked dependencies"
52+
if: ${{ matrix.dependencies == 'locked' }}
53+
run: "composer install --no-interaction --no-progress --no-suggest"
54+
55+
- name: "psalm"
56+
run: "vendor/bin/psalm --output-format=github --shepherd --stats"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ app.env
33
.phpunit.result.cache
44
build/*
55
vendor/
6-
composer.lock
76
.idea
87
.php_cs.cache

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,25 @@
3333
"laminas/laminas-filter": "^2.9",
3434
"open-code-modeling/php-filter": "^0.1.1",
3535
"phpspec/prophecy-phpunit": "^2.0",
36-
"phpstan/phpstan": "^0.12.33",
37-
"phpstan/phpstan-strict-rules": "^0.12.4",
3836
"phpunit/phpunit": "^9.5.0",
39-
"prooph/php-cs-fixer-config": "^v0.3.1",
40-
"roave/security-advisories": "dev-master"
37+
"prooph/php-cs-fixer-config": "^v0.4.0",
38+
"psalm/plugin-phpunit": "^0.15.0",
39+
"roave/security-advisories": "dev-master",
40+
"vimeo/psalm": "^4.4"
4141
},
4242
"minimum-stability": "dev",
4343
"prefer-stable": true,
4444
"scripts": {
4545
"check": [
4646
"@cs",
4747
"@test",
48-
"@analyse"
48+
"@static-analysis"
4949
],
50-
"docheader": "vendor/bin/docheader check src/ tests/",
5150
"cs": "php-cs-fixer fix -v --diff --dry-run",
5251
"cs-fix": "php-cs-fixer fix -v --diff",
53-
"test": "vendor/bin/phpunit",
54-
"analyse": "php vendor/bin/phpstan.phar analyse --no-interaction"
52+
"test": "phpunit --colors=always",
53+
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
54+
"static-analysis": "psalm --shepherd --stats"
5555
},
5656
"config": {
5757
"sort-packages": true,

0 commit comments

Comments
 (0)