Skip to content

Commit

Permalink
Migrate Psalm to PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Aug 6, 2024
1 parent 3f3cc9c commit bbdb70e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 84 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ jobs:
with:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.3'
tools: composer, composer-require-checker, composer-unused, phpcs, psalm
# optional performance gain for psalm: opcache
tools: composer, composer-require-checker, composer-unused, phpcs, phpstan
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, pcre, spl, xml

- name: Setup problem matchers for PHP
Expand Down Expand Up @@ -84,27 +83,13 @@ jobs:
- name: PHP Code Sniffer
run: phpcs

- name: Psalm
continue-on-error: true
- name: PHPStan
run: |
psalm -c psalm.xml \
--show-info=true \
--shepherd \
--php-version=${{ steps.setup-php.outputs.php-version }}
phpstan analyze -c phpstan.neon --debug
- name: Psalm (testsuite)
- name: PHPStan (testsuite)
run: |
psalm -c psalm-dev.xml \
--show-info=true \
--shepherd \
--php-version=${{ steps.setup-php.outputs.php-version }}
- name: Psalter
run: |
psalm --alter \
--issues=UnnecessaryVarAnnotation \
--dry-run \
--php-version=${{ steps.setup-php.outputs.php-version }}
phpstan analyze -c phpstan-dev.neon --debug
security:
name: Security checks
Expand Down
11 changes: 11 additions & 0 deletions phpstan-dev-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
parameters:
ignoreErrors:
-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: tests/src/Controller/RegProcessTest.php

-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: tests/src/Controller/RegistrationTest.php
4 changes: 4 additions & 0 deletions phpstan-dev.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: 5
paths:
- tests
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: 5
paths:
- src
27 changes: 0 additions & 27 deletions psalm-dev.xml

This file was deleted.

37 changes: 0 additions & 37 deletions psalm.xml

This file was deleted.

0 comments on commit bbdb70e

Please sign in to comment.