Skip to content

Commit bba4c20

Browse files
committed
use global import
1 parent 061a2a3 commit bba4c20

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/TwoFactorAuth.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use RobThree\Auth\Providers\Time\ITimeProvider;
1515
use RobThree\Auth\Providers\Time\LocalMachineTimeProvider;
1616
use RobThree\Auth\Providers\Time\NTPTimeProvider;
17+
use SensitiveParameter;
1718

1819
// Based on / inspired by: https://github.com/PHPGangsta/GoogleAuthenticator
1920
// Algorithms, digits, period etc. explained: https://github.com/google/google-authenticator/wiki/Key-Uri-Format
@@ -69,7 +70,7 @@ public function createSecret(int $bits = 80, bool $requirecryptosecure = true):
6970
/**
7071
* Calculate the code with given secret and point in time
7172
*/
72-
public function getCode(#[\SensitiveParameter] string $secret, ?int $time = null): string
73+
public function getCode(#[SensitiveParameter] string $secret, ?int $time = null): string
7374
{
7475
$secretkey = $this->base32Decode($secret);
7576

@@ -107,7 +108,7 @@ public function verifyCode(string $secret, string $code, int $discrepancy = 1, ?
107108
/**
108109
* Get data-uri of QRCode
109110
*/
110-
public function getQRCodeImageAsDataUri(string $label, #[\SensitiveParameter] string $secret, int $size = 200): string
111+
public function getQRCodeImageAsDataUri(string $label, #[SensitiveParameter] string $secret, int $size = 200): string
111112
{
112113
if ($size <= 0) {
113114
throw new TwoFactorAuthException('Size must be > 0');
@@ -153,7 +154,7 @@ public function ensureCorrectTime(?array $timeproviders = null, int $leniency =
153154
/**
154155
* Builds a string to be encoded in a QR code
155156
*/
156-
public function getQRText(string $label, #[\SensitiveParameter] string $secret): string
157+
public function getQRText(string $label, #[SensitiveParameter] string $secret): string
157158
{
158159
return 'otpauth://totp/' . rawurlencode($label)
159160
. '?secret=' . rawurlencode($secret)

0 commit comments

Comments
 (0)