diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-26 12:18:21 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-26 12:31:02 +0300 |
commit | 24b12385d0e5f7483a64f2abf543f9c4e09a6eaa (patch) | |
tree | 28e6811140d6ebf90e7effd53b5a74976560cccf /lib/public/Authentication | |
parent | e2b44d199bea7da74811689ec3ab787135e22de6 (diff) |
Strict 2FA
* make OCP\Authentication\TwoFactorAuth strict
* scalar types
* return types
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/public/Authentication')
3 files changed, 12 insertions, 8 deletions
diff --git a/lib/public/Authentication/TwoFactorAuth/IProvider.php b/lib/public/Authentication/TwoFactorAuth/IProvider.php index c4c481a2f32..84752cecc77 100644 --- a/lib/public/Authentication/TwoFactorAuth/IProvider.php +++ b/lib/public/Authentication/TwoFactorAuth/IProvider.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -43,7 +44,7 @@ interface IProvider { * * @return string */ - public function getId(); + public function getId(): string; /** * Get the display name for selecting the 2FA provider @@ -54,7 +55,7 @@ interface IProvider { * * @return string */ - public function getDisplayName(); + public function getDisplayName(): string; /** * Get the description for selecting the 2FA provider @@ -65,7 +66,7 @@ interface IProvider { * * @return string */ - public function getDescription(); + public function getDescription(): string; /** * Get the template for rending the 2FA provider view @@ -75,7 +76,7 @@ interface IProvider { * @param IUser $user * @return Template */ - public function getTemplate(IUser $user); + public function getTemplate(IUser $user): Template; /** * Verify the given challenge @@ -84,8 +85,9 @@ interface IProvider { * * @param IUser $user * @param string $challenge + * @return bool */ - public function verifyChallenge(IUser $user, $challenge); + public function verifyChallenge(IUser $user, string $challenge): bool; /** * Decides whether 2FA is enabled for the given user @@ -93,7 +95,7 @@ interface IProvider { * @since 9.1.0 * * @param IUser $user - * @return boolean + * @return bool */ - public function isTwoFactorAuthEnabledForUser(IUser $user); + public function isTwoFactorAuthEnabledForUser(IUser $user): bool; } diff --git a/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php b/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php index 2a498adc0b8..3b477dc53fe 100644 --- a/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php +++ b/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * * @@ -35,5 +36,5 @@ interface IProvidesCustomCSP { * * @since 13.0.0 */ - public function getCSP(); + public function getCSP(): ContentSecurityPolicy; } diff --git a/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php b/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php index a18b9e8c4a8..d94c3e61465 100644 --- a/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php +++ b/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud GmbH. * |