Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/twofactor_totp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-03-12 16:04:08 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2018-03-12 16:04:08 +0300
commit8dc7bbab04108a61c8ae218a99f093d0843a7f06 (patch)
treea64b28d941c7116817f9dcdb2f44496209696226 /lib/Service/Totp.php
parent2b8058a660e8a432f842eb195f885eeb65ee3087 (diff)
Make app strict
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Service/Totp.php')
-rw-r--r--lib/Service/Totp.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Service/Totp.php b/lib/Service/Totp.php
index aaa38d8..47ec8cc 100644
--- a/lib/Service/Totp.php
+++ b/lib/Service/Totp.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types = 1);
+
/**
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @copyright Copyright (c) 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -62,7 +64,7 @@ class Totp implements ITotp {
/**
* @param IUser $user
*/
- public function createSecret(IUser $user) {
+ public function createSecret(IUser $user): string {
try {
// Delet existing one
$oldSecret = $this->secretMapper->getSecret($user);
@@ -99,7 +101,7 @@ class Totp implements ITotp {
$this->activityManager->publish($activity);
}
- public function enable(IUser $user, $key) {
+ public function enable(IUser $user, $key): bool {
if (!$this->validateSecret($user, $key)) {
return false;
}
@@ -121,7 +123,7 @@ class Totp implements ITotp {
$this->publishEvent($user, 'totp_disabled');
}
- public function validateSecret(IUser $user, $key) {
+ public function validateSecret(IUser $user, $key): bool {
try {
$dbSecret = $this->secretMapper->getSecret($user);
} catch (DoesNotExistException $ex) {