From fedf9c69d9c84fc0399badef39ed765de72c08f1 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 19 Aug 2020 17:54:00 +0200 Subject: Use matching parameter names form interfaces and implementations Found by Psalm 3.14.1 Signed-off-by: Morris Jobke --- lib/private/Authentication/Token/IProvider.php | 4 ++-- lib/private/Authentication/Token/PublicKeyTokenProvider.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/private/Authentication') diff --git a/lib/private/Authentication/Token/IProvider.php b/lib/private/Authentication/Token/IProvider.php index 384828c207e..2b6223fded9 100644 --- a/lib/private/Authentication/Token/IProvider.php +++ b/lib/private/Authentication/Token/IProvider.php @@ -140,13 +140,13 @@ interface IProvider { /** * Get the (unencrypted) password of the given token * - * @param IToken $token + * @param IToken $savedToken * @param string $tokenId * @throws InvalidTokenException * @throws PasswordlessTokenException * @return string */ - public function getPassword(IToken $token, string $tokenId): string; + public function getPassword(IToken $savedToken, string $tokenId): string; /** * Encrypt and set the password of the given token diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php index 091f47d7da3..7fe4a0d8703 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -227,20 +227,20 @@ class PublicKeyTokenProvider implements IProvider { return $this->mapper->getTokenByUser($uid); } - public function getPassword(IToken $token, string $tokenId): string { - if (!($token instanceof PublicKeyToken)) { + public function getPassword(IToken $savedToken, string $tokenId): string { + if (!($savedToken instanceof PublicKeyToken)) { throw new InvalidTokenException("Invalid token type"); } - if ($token->getPassword() === null) { + if ($savedToken->getPassword() === null) { throw new PasswordlessTokenException(); } // Decrypt private key with tokenId - $privateKey = $this->decrypt($token->getPrivateKey(), $tokenId); + $privateKey = $this->decrypt($savedToken->getPrivateKey(), $tokenId); // Decrypt password with private key - return $this->decryptPassword($token->getPassword(), $privateKey); + return $this->decryptPassword($savedToken->getPassword(), $privateKey); } public function setPassword(IToken $token, string $tokenId, string $password) { -- cgit v1.2.3