Skip to content

Commit af46942

Browse files
committed
Replace Psalm with PHPStan
1 parent b12eaad commit af46942

8 files changed

Lines changed: 22 additions & 76 deletions

File tree

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ codecov.yml export-ignore
55
.editorconfig export-ignore
66
.gitattributes export-ignore
77
.gitignore export-ignore
8-
psalm.xml export-ignore
9-
psalm-dev.xml export-ignore
8+
phpstan.xml export-ignore
9+
phpstan-dev.xml export-ignore
1010
phpcs.xml export-ignore
1111
phpunit.xml export-ignore
1212
.php_cs.dist export-ignore

.github/workflows/php.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,8 @@ jobs:
161161
with:
162162
# Should be the higest supported version, so we can use the newest tools
163163
php-version: '8.5'
164-
tools: composer, composer-require-checker, composer-unused, psalm
165-
# optional performance gain for psalm: opcache
166-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, pcre, posix, spl, xml
164+
tools: composer, composer-require-checker, composer-unused
165+
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
167166

168167
- name: Setup problem matchers for PHP
169168
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
@@ -195,27 +194,13 @@ jobs:
195194
- name: PHP Code Sniffer
196195
run: vendor/bin/phpcs
197196

198-
- name: Psalm
199-
continue-on-error: true
200-
run: |
201-
psalm -c psalm.xml \
202-
--show-info=true \
203-
--shepherd \
204-
--php-version=${{ steps.setup-php.outputs.php-version }}
205-
206-
- name: Psalm (testsuite)
197+
- name: PHPStan
207198
run: |
208-
psalm -c psalm-dev.xml \
209-
--show-info=true \
210-
--shepherd \
211-
--php-version=${{ steps.setup-php.outputs.php-version }}
199+
vendor/bin/phpstan analyze -c phpstan.neon --debug
212200
213-
- name: Psalter
201+
- name: PHPStan (testsuite)
214202
run: |
215-
psalm --alter \
216-
--issues=UnnecessaryVarAnnotation \
217-
--dry-run \
218-
--php-version=${{ steps.setup-php.outputs.php-version }}
203+
vendor/bin/phpstan analyze -c phpstan-dev.neon --debug
219204
220205
security:
221206
name: Security checks

phpstan-dev.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 9
3+
paths:
4+
- tests

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 8
3+
paths:
4+
- src

psalm-dev.xml

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

psalm.xml

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

src/Auth/Process/SmartID.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class SmartID extends \SimpleSAML\Auth\ProcessingFilter
5656

5757

5858
/**
59-
* @param array $config
59+
* @param array<mixed> $config
6060
* @param mixed $reserved
6161
* @throws \Exception
6262
*/
@@ -107,8 +107,8 @@ public function __construct(array $config, $reserved)
107107

108108

109109
/**
110-
* @param array $attributes
111-
* @param array $request
110+
* @param array<mixed> $attributes
111+
* @param array<mixed> $request
112112
* @return string
113113
* @throws \SimpleSAML\Error\Exception
114114
*/
@@ -150,7 +150,7 @@ private function addID(array $attributes, array $request): string
150150
*
151151
* Add or replace existing attributes with the configured values.
152152
*
153-
* @param array &$state The current request
153+
* @param array<mixed> &$state The current request
154154
*/
155155
public function process(array &$state): void
156156
{

src/Auth/Process/SmartName.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class SmartName extends Auth\ProcessingFilter
1616
{
1717
/**
18-
* @param array $attributes
18+
* @param array<mixed> $attributes
1919
* @return string|null
2020
*/
2121
private function getFullName(array $attributes): ?string
@@ -79,7 +79,7 @@ private function getLocalUser(string $userid): ?string
7979
*
8080
* Add or replace existing attributes with the configured values.
8181
*
82-
* @param array &$state The current request
82+
* @param array<mixed> &$state The current request
8383
*/
8484
public function process(array &$state): void
8585
{

0 commit comments

Comments
 (0)