Skip to content

Commit 82453b9

Browse files
committed
fixed CS
1 parent 11304b0 commit 82453b9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Encoder/Argon2idPasswordEncoder.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ public function encodePassword($raw, $salt)
4646
if (\defined('PASSWORD_ARGON2ID')) {
4747
return $this->encodePasswordNative($raw, \PASSWORD_ARGON2ID);
4848
}
49-
if (\defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) {
50-
$hash = \sodium_crypto_pwhash_str(
51-
$raw,
52-
\SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
53-
\SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
54-
);
55-
\sodium_memzero($raw);
56-
57-
return $hash;
49+
if (!\defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) {
50+
throw new LogicException('Algorithm "argon2id" is not supported. Please install the libsodium extension or upgrade to PHP 7.3+.');
5851
}
5952

60-
throw new LogicException('Algorithm "argon2id" is not supported. Please install the libsodium extension or upgrade to PHP 7.3+.');
53+
$hash = \sodium_crypto_pwhash_str(
54+
$raw,
55+
\SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
56+
\SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
57+
);
58+
\sodium_memzero($raw);
59+
60+
return $hash;
6161
}
6262

6363
/**

0 commit comments

Comments
 (0)