aboutsummaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-03-28 16:13:19 +0100
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-04-02 14:16:21 +0200
commitec5133b739eabc76271789504b4dbb91a534f552 (patch)
tree880b81f5ebd11b289c67e4bcdd1ecaa41aedbcb4 /apps/twofactor_backupcodes
parentb074399a87e764f506550d64f6379738186355c6 (diff)
downloadnextcloud-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.php2
-rw-r--r--apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php4
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;