From 63fbf90570e7ed905fc323e4e212c28dc100994c Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Mon, 8 Jan 2024 17:47:22 +0100 Subject: Suppress or fix psalm errors related to InvalidTokenException MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Authentication/Token/IProvider.php | 6 +++--- lib/private/Authentication/Token/Manager.php | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/private/Authentication/Token/IProvider.php b/lib/private/Authentication/Token/IProvider.php index 4af5e2b25c3..b852f4e7e86 100644 --- a/lib/private/Authentication/Token/IProvider.php +++ b/lib/private/Authentication/Token/IProvider.php @@ -29,10 +29,10 @@ declare(strict_types=1); */ namespace OC\Authentication\Token; -use OC\Authentication\Exceptions\ExpiredTokenException; -use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Exceptions\PasswordlessTokenException; -use OC\Authentication\Exceptions\WipeTokenException; +use OCP\Authentication\Exceptions\ExpiredTokenException; +use OCP\Authentication\Exceptions\InvalidTokenException; +use OCP\Authentication\Exceptions\WipeTokenException; interface IProvider { /** diff --git a/lib/private/Authentication/Token/Manager.php b/lib/private/Authentication/Token/Manager.php index 9154092f25a..d84a81705ff 100644 --- a/lib/private/Authentication/Token/Manager.php +++ b/lib/private/Authentication/Token/Manager.php @@ -29,9 +29,9 @@ namespace OC\Authentication\Token; use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use OC\Authentication\Exceptions\InvalidTokenException as OcInvalidTokenException; +use OC\Authentication\Exceptions\PasswordlessTokenException; use OCP\Authentication\Exceptions\ExpiredTokenException; use OCP\Authentication\Exceptions\InvalidTokenException; -use OCP\Authentication\Exceptions\PasswordlessTokenException; use OCP\Authentication\Exceptions\WipeTokenException; use OCP\Authentication\Token\IProvider as OCPIProvider; @@ -222,6 +222,7 @@ class Manager implements IProvider, OCPIProvider { return $this->publicKeyTokenProvider->rotate($token, $oldTokenId, $newTokenId); } + /** @psalm-suppress DeprecatedClass We have to throw the OC version so both OC and OCP catches catch it */ throw new OcInvalidTokenException(); } @@ -234,6 +235,7 @@ class Manager implements IProvider, OCPIProvider { if ($token instanceof PublicKeyToken) { return $this->publicKeyTokenProvider; } + /** @psalm-suppress DeprecatedClass We have to throw the OC version so both OC and OCP catches catch it */ throw new OcInvalidTokenException(); } -- cgit v1.2.3