Skip to content

Commit

Permalink
chore: add Psalm again
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoulain committed Feb 16, 2025
1 parent 50e8309 commit 0843a21
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/infection.json export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/psalm.xml export-ignore
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ jobs:
- name: Analyze code (PHPStan)
run: vendor/bin/phpstan analyze . --ansi --no-progress --error-format=github

- name: Analyze code (Psalm)
if: ${{ !startsWith(matrix.symfony, '5') }}
run: vendor/bin/psalm --php-version=${{ matrix.php }} --long-progress --output-format=github --shepherd --stats

- name: Run functional tests
if: ${{ !startsWith(matrix.symfony, '4') }}
run: vendor/bin/behat --colors

- name: Run unit tests
Expand Down
2 changes: 1 addition & 1 deletion EventListener/ValidateSignedRouteListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(UrlSignerInterface $urlSigner)
public function validateSignedRoute(RequestEvent $event): void
{
$request = $event->getRequest();
/** @var array{_signed?: bool} $routeParams */
/** @var array{_signed?: bool, _locale?: string} $routeParams */
$routeParams = $request->attributes->get('_route_params');

if (!$routeParams || !($routeParams['_signed'] ?? false)) {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Actions Status](https://github.com/coopTilleuls/UrlSignerBundle/workflows/CI/badge.svg)](https://github.com/coopTilleuls/UrlSignerBundle/actions)
[![Coverage Status](https://coveralls.io/repos/github/coopTilleuls/UrlSignerBundle/badge.svg?branch=main)](https://coveralls.io/github/coopTilleuls/UrlSignerBundle?branch=main)
[![Infection MSI](https://img.shields.io/endpoint?url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FcoopTilleuls%2FUrlSignerBundle%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/coopTilleuls/UrlSignerBundle/main)
[![Type Coverage](https://shepherd.dev/github/coopTilleuls/UrlSignerBundle/coverage.svg)](https://shepherd.dev/github/coopTilleuls/UrlSignerBundle)

Create and validate signed URLs with a limited lifetime in Symfony.

Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^10.0 || ^11.0",
"psalm/plugin-phpunit": "^0.19",
"psalm/plugin-symfony": "^5.2",
"symfony/browser-kit": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0"
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"vimeo/psalm": "^6.6"
},
"config": {
"sort-packages": true,
Expand Down
22 changes: 22 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="." />
<ignoreFiles>
<file name="features/app/src/Kernel.php" />
<directory name="features/app/var" />
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin" />
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin" />
</plugins>
</psalm>

0 comments on commit 0843a21

Please sign in to comment.