Skip to content

Commit bb9e3c6

Browse files
committed
Replace psalm with phpstan
1 parent 09a5a64 commit bb9e3c6

File tree

6 files changed

+20
-56
lines changed

6 files changed

+20
-56
lines changed

.github/workflows/php.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,13 @@ jobs:
8686
- name: PHP Code Sniffer
8787
run: phpcs
8888

89-
- name: Psalm
89+
- name: PHPStan
9090
run: |
91-
psalm -c psalm.xml \
92-
--show-info=true \
93-
--shepherd \
94-
--php-version=${{ steps.setup-php.outputs.php-version }}
91+
vendor/bin/phpstan analyze -c phpstan.neon
9592
96-
- name: Psalm (testsuite)
93+
- name: PHPStan (testsuite)
9794
run: |
98-
psalm -c psalm-dev.xml \
99-
--show-info=true \
100-
--shepherd \
101-
--php-version=${{ steps.setup-php.outputs.php-version }}
102-
103-
- name: Psalter
104-
run: |
105-
psalm --alter \
106-
--issues=UnnecessaryVarAnnotation \
107-
--dry-run \
108-
--php-version=${{ steps.setup-php.outputs.php-version }}
95+
vendor/bin/phpstan analyze -c phpstan-dev.neon
10996
11097
security:
11198
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: 5
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: 6
3+
paths:
4+
- src

psalm.xml

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

src/Auth/Process/Authorize.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Authorize extends Auth\ProcessingFilter
4747
/**
4848
* Array of localised rejection messages
4949
*
50-
* @var array
50+
* @var string[]
5151
*/
5252
protected array $reject_msg = [];
5353

@@ -60,9 +60,9 @@ class Authorize extends Auth\ProcessingFilter
6060

6161
/**
6262
* Array of valid users. Each element is a regular expression. You should
63-
* user \ to escape special chars, like '.' etc.
63+
* use \ to escape special chars, like '.' etc.
6464
*
65-
* @param array
65+
* @var array<mixed>
6666
*/
6767
protected array $valid_attribute_values = [];
6868

@@ -82,7 +82,7 @@ class Authorize extends Auth\ProcessingFilter
8282
* Initialize this filter.
8383
* Validate configuration parameters.
8484
*
85-
* @param array $config Configuration information about this filter.
85+
* @param array<mixed> $config Configuration information about this filter.
8686
* @param mixed $reserved For future use.
8787
*/
8888
public function __construct(array $config, $reserved)
@@ -155,7 +155,7 @@ public function __construct(array $config, $reserved)
155155
/**
156156
* Apply filter to validate attributes.
157157
*
158-
* @param array &$state The current request
158+
* @param array<mixed> &$state The current request
159159
*/
160160
public function process(array &$state): void
161161
{
@@ -225,7 +225,7 @@ public function process(array &$state): void
225225
* thinking in case a "chained" ACL is needed, more complex
226226
* permission logic.
227227
*
228-
* @param array $state
228+
* @param array<mixed> $state
229229
*/
230230
protected function unauthorized(array &$state): void
231231
{

src/Controller/Authorize.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function forbidden(Request $request): Template
5151
throw new Error\BadRequest('Missing required StateId query parameter.');
5252
}
5353

54-
/** @var array $state */
54+
/** @var array<mixed> $state */
5555
$state = Auth\State::loadState($stateId, 'authorize:Authorize');
5656

5757
$t = new Template($this->config, 'authorize:authorize_403.twig');
@@ -108,7 +108,7 @@ public function reauthenticate(Request $request): void
108108
if (!is_string($stateId)) {
109109
throw new Error\BadRequest('Missing required StateId query parameter.');
110110
}
111-
/** @var array $state */
111+
/** @var array<mixed> $state */
112112
$state = Auth\State::loadState($stateId, 'authorize:Authorize');
113113

114114
$authSource = $state['Source']['auth'];

0 commit comments

Comments
 (0)