Skip to content

Commit fb6b1b2

Browse files
authored
Merge pull request #417 from os2display/feature/psalm-to-phpstan
Psalm to phpstan
2 parents 19e0a9e + 987ae75 commit fb6b1b2

51 files changed

Lines changed: 4426 additions & 3946 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
on: pull_request
22

3-
name: Psalm
3+
name: Code Analysis
44

55
jobs:
6-
psalm:
6+
phpstan:
77
runs-on: ubuntu-latest
88
strategy:
99
fail-fast: false
1010
matrix:
1111
php: ["8.4"]
12-
name: Psalm (PHP ${{ matrix.php }})
12+
name: PHPStan (PHP ${{ matrix.php }})
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
@@ -33,7 +33,7 @@ jobs:
3333
restore-keys: ${{ matrix.php }}-composer-
3434

3535
- name: Install Dependencies
36-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
36+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
3737

38-
- name: Psalm
39-
run: phpdbg -qrr ./vendor/bin/psalm
38+
- name: PHPStan
39+
run: vendor/bin/phpstan analyse --no-progress

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ All notable changes to this project will be documented in this file.
3939
- Added BRND to feed source admin dropdown.
4040
- Upgraded to PHP 8.4.
4141
- Changed default CLIENT_PULL_STRATEGY_INTERVAL value to 10 minutes.
42+
- Changed code analysis tool from psalm to phpstan.
43+
- Changed src/Controller/Api/AuthOidcController.php to get session from request.
4244

4345
### NB! Prior to 3.x the project was split into separate repositories
4446

Taskfile.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,29 @@ tasks:
167167
cmds:
168168
- task composer -- code-analysis
169169

170-
psalm:update-baseline:
171-
desc: "Updates the Psalm baseline file."
170+
phpstan:generate-baseline:
171+
desc: "Generates the PHPStan baseline file."
172172
cmds:
173-
- task compose -- exec phpfpm vendor/bin/psalm --update-baseline
173+
- task compose -- exec phpfpm vendor/bin/phpstan analyse --generate-baseline --no-progress
174+
175+
rector:apply:
176+
desc: "Runs Rector."
177+
cmds:
178+
- task compose -- exec phpfpm vendor/bin/rector
179+
180+
rector:check:
181+
desc: "Runs Rector in dry-run mode."
182+
cmds:
183+
- task compose -- exec phpfpm vendor/bin/rector --dry-run
184+
185+
run-checks-and-tests:
186+
desc: "Runs all checks: coding standards, code analysis, rector, and tests."
187+
cmds:
188+
- task coding-standards:check
189+
- task code-analysis
190+
- task rector:check
191+
- task test:api
192+
- task test:frontend-local
174193

175194
fixtures:load:
176195
prompt: "This will reset your content. Continue?"

composer.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@
5252
"ergebnis/composer-normalize": "^2.15",
5353
"friendsofphp/php-cs-fixer": "^3.0",
5454
"hautelook/alice-bundle": "^2.9",
55+
"phpstan/extension-installer": "^1.4",
56+
"phpstan/phpstan": "^2.1",
57+
"phpstan/phpstan-doctrine": "^2.0",
58+
"phpstan/phpstan-symfony": "^2.0",
5559
"phpunit/phpunit": "^9.5",
56-
"psalm/plugin-symfony": "^5.3",
57-
"rector/rector": "^1.0",
60+
"rector/rector": "^2.4",
5861
"symfony/browser-kit": "~6.4.0",
5962
"symfony/css-selector": "~6.4.0",
6063
"symfony/debug-bundle": "~6.4.0",
@@ -63,9 +66,7 @@
6366
"symfony/stopwatch": "~6.4.0",
6467
"symfony/var-dumper": "~6.4.0",
6568
"symfony/web-profiler-bundle": "~6.4.0",
66-
"vimeo/psalm": "^6.13.0",
67-
"vincentlanglet/twig-cs-fixer": "^3.8",
68-
"weirdan/doctrine-psalm-plugin": "^2.10"
69+
"vincentlanglet/twig-cs-fixer": "^3.8"
6970
},
7071
"replace": {
7172
"symfony/polyfill-ctype": "*",
@@ -92,6 +93,7 @@
9293
"composer/package-versions-deprecated": true,
9394
"ergebnis/composer-normalize": true,
9495
"php-http/discovery": true,
96+
"phpstan/extension-installer": true,
9597
"symfony/flex": true,
9698
"symfony/runtime": true
9799
},
@@ -121,7 +123,7 @@
121123
"cache:clear": "symfony-cmd",
122124
"assets:install %PUBLIC_DIR%": "symfony-cmd"
123125
},
124-
"code-analysis": "vendor/bin/psalm --no-cache",
126+
"code-analysis": "vendor/bin/phpstan analyse --no-progress",
125127
"coding-standards-apply": [
126128
"vendor/bin/php-cs-fixer fix"
127129
],

0 commit comments

Comments
 (0)