diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-03-28 16:13:19 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-04-02 14:16:21 +0200 |
commit | ec5133b739eabc76271789504b4dbb91a534f552 (patch) | |
tree | 880b81f5ebd11b289c67e4bcdd1ecaa41aedbcb4 /apps/twofactor_backupcodes | |
parent | b074399a87e764f506550d64f6379738186355c6 (diff) | |
download | nextcloud-server-ec5133b739eabc76271789504b4dbb91a534f552.tar.gz nextcloud-server-ec5133b739eabc76271789504b4dbb91a534f552.zip |
fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/twofactor_backupcodes')
-rw-r--r-- | apps/twofactor_backupcodes/lib/Activity/Provider.php | 2 | ||||
-rw-r--r-- | apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/twofactor_backupcodes/lib/Activity/Provider.php b/apps/twofactor_backupcodes/lib/Activity/Provider.php index 2d60c8fe3f1..ffb67fcab8d 100644 --- a/apps/twofactor_backupcodes/lib/Activity/Provider.php +++ b/apps/twofactor_backupcodes/lib/Activity/Provider.php @@ -56,7 +56,7 @@ class Provider implements IProvider { $this->l10n = $l10n; } - public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null): IEvent { if ($event->getApp() !== 'twofactor_backupcodes') { throw new InvalidArgumentException(); } diff --git a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php index 9d4b6a28500..92c53e64917 100644 --- a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php +++ b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php @@ -108,7 +108,7 @@ class BackupCodeStorage { $total = count($codes); $used = 0; array_walk($codes, function (BackupCode $code) use (&$used) { - if (1 === (int)$code->getUsed()) { + if ((int)$code->getUsed() === 1) { $used++; } }); @@ -128,7 +128,7 @@ class BackupCodeStorage { $dbCodes = $this->mapper->getBackupCodes($user); foreach ($dbCodes as $dbCode) { - if (0 === (int)$dbCode->getUsed() && $this->hasher->verify($code, $dbCode->getCode())) { + if ((int)$dbCode->getUsed() === 0 && $this->hasher->verify($code, $dbCode->getCode())) { $dbCode->setUsed(1); $this->mapper->update($dbCode); return true; |