Skip to content

Commit 11e02cf

Browse files
committed
fix: Remove a static var usage in encryption application
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent f3882a5 commit 11e02cf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

apps/encryption/lib/Services/PassphraseService.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
use Psr\Log\LoggerInterface;
2222

2323
class PassphraseService {
24-
2524
/** @var array<string, bool> */
26-
private static array $passwordResetUsers = [];
25+
private array $passwordResetUsers = [];
2726

2827
public function __construct(
2928
private Util $util,
@@ -39,9 +38,9 @@ public function __construct(
3938

4039
public function setProcessingReset(string $uid, bool $processing = true): void {
4140
if ($processing) {
42-
self::$passwordResetUsers[$uid] = true;
41+
$this->passwordResetUsers[$uid] = true;
4342
} else {
44-
unset(self::$passwordResetUsers[$uid]);
43+
unset($this->passwordResetUsers[$uid]);
4544
}
4645
}
4746

@@ -51,7 +50,7 @@ public function setProcessingReset(string $uid, bool $processing = true): void {
5150
public function setPassphraseForUser(string $userId, string $password, ?string $recoveryPassword = null): bool {
5251
// if we are in the process to resetting a user password, we have nothing
5352
// to do here
54-
if (isset(self::$passwordResetUsers[$userId])) {
53+
if (isset($this->passwordResetUsers[$userId])) {
5554
return true;
5655
}
5756

0 commit comments

Comments
 (0)