Skip to content

Commit

Permalink
fix psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptouuuu committed Aug 1, 2024
1 parent 3bf819c commit 7451790
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [Unreleased]

### Fixed

- `Innmind\Framework\Http\To` no longer raise Psalm errors when used as argument to `Framework::route()`

## 2.2.0 - 2024-03-24

### Added
Expand Down
4 changes: 4 additions & 0 deletions src/Http/To.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

namespace Innmind\Framework\Http;

use Innmind\Framework\Environment;
use Innmind\Http\{
ServerRequest,
Response,
};
use Innmind\DI\Container;
use Innmind\OperatingSystem\OperatingSystem;
use Innmind\Router\Route\Variables;

final class To
Expand All @@ -23,6 +25,8 @@ public function __invoke(
ServerRequest $request,
Variables $variables,
Container $container,
OperatingSystem $os = null, // these arguments are not used, there here
Environment $env = null, // to satisfy Psalm when used in Framework::route()
): Response {
/**
* @psalm-suppress InvalidFunctionCall If it fails here then the service doesn't conform to the signature callable(ServerRequest, Variables): Response
Expand Down

0 comments on commit 7451790

Please sign in to comment.