From a22a2e72d38d75d9f7a124af86eeba2e8bc6966e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 17 Aug 2026 14:56:55 +0200 Subject: [PATCH] fix(psalm): Remove entries from the baseline Signed-off-by: Carl Schwan --- .../lib/Controller/OauthApiController.php | 2 +- .../Controller/OauthApiControllerTest.php | 1 + build/psalm-baseline.xml | 20 ------------------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php index c085c790e22..9f089ce2d42 100644 --- a/apps/oauth2/lib/Controller/OauthApiController.php +++ b/apps/oauth2/lib/Controller/OauthApiController.php @@ -70,7 +70,6 @@ final class OauthApiController extends Controller { * Get a token * * @param 'authorization_code'|'refresh_token' $grant_type Token type that should be granted - * @psalm-param string $grant_type * @param ?string $code Code of the flow * @param ?string $refresh_token Refresh token * @param ?string $client_id Client ID @@ -90,6 +89,7 @@ final class OauthApiController extends Controller { ): JSONResponse { // We only handle two types + /** @psalm-suppress DocblockTypeContradiction We don't trust user input */ if ($grant_type !== 'authorization_code' && $grant_type !== 'refresh_token') { $response = new JSONResponse([ 'error' => 'invalid_grant', diff --git a/apps/oauth2/tests/Controller/OauthApiControllerTest.php b/apps/oauth2/tests/Controller/OauthApiControllerTest.php index 82c2c57ab44..6efa02fe62b 100644 --- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php +++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php @@ -124,6 +124,7 @@ final class OauthApiControllerTest extends TestCase { ], Http::STATUS_BAD_REQUEST); $expected->throttle(['invalid_grant' => 'foo']); + /** @psalm-suppress InvalidArgument Test that we don't trust user input */ $this->assertEquals($expected, $this->oauthApiController->getToken('foo', null, null, null, null)); } diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 035c0bf223d..ea48a97dcc6 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -2226,26 +2226,6 @@ - - - - - - - - - - - - request->server]]> - - - - - - - - getUID())]]>