Skip to content

Commit dcab5ac

Browse files
CS fixes
1 parent e97a1b3 commit dcab5ac

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Command/UserPasswordHashCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
152152
$io->table(['Key', 'Value'], $rows);
153153

154154
if (!$emptySalt) {
155-
$errorIo->note(sprintf('Make sure that your salt storage field fits the salt length: %s chars', \strlen($salt)));
155+
$errorIo->note(\sprintf('Make sure that your salt storage field fits the salt length: %s chars', \strlen($salt)));
156156
} elseif ($saltlessWithoutEmptySalt) {
157157
$errorIo->note('Self-salting hasher used: the hasher generated its own built-in salt.');
158158
}

Hasher/MessageDigestPasswordHasher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function hash(#[\SensitiveParameter] string $plainPassword, ?string $salt
5555
}
5656

5757
if (!\in_array($this->algorithm, hash_algos(), true)) {
58-
throw new LogicException(sprintf('The algorithm "%s" is not supported.', $this->algorithm));
58+
throw new LogicException(\sprintf('The algorithm "%s" is not supported.', $this->algorithm));
5959
}
6060

6161
$salted = $this->mergePasswordAndSalt($plainPassword, $salt);

Hasher/PasswordHasherFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getPasswordHasher(string|PasswordAuthenticatedUserInterface|Pass
3939

4040
if ($user instanceof PasswordHasherAwareInterface && null !== $hasherName = $user->getPasswordHasherName()) {
4141
if (!\array_key_exists($hasherName, $this->passwordHashers)) {
42-
throw new \RuntimeException(sprintf('The password hasher "%s" was not configured.', $hasherName));
42+
throw new \RuntimeException(\sprintf('The password hasher "%s" was not configured.', $hasherName));
4343
}
4444

4545
$hasherKey = $hasherName;
@@ -53,7 +53,7 @@ public function getPasswordHasher(string|PasswordAuthenticatedUserInterface|Pass
5353
}
5454

5555
if (null === $hasherKey) {
56-
throw new \RuntimeException(sprintf('No password hasher has been configured for account "%s".', \is_object($user) ? get_debug_type($user) : $user));
56+
throw new \RuntimeException(\sprintf('No password hasher has been configured for account "%s".', \is_object($user) ? get_debug_type($user) : $user));
5757
}
5858

5959
if (!$this->passwordHashers[$hasherKey] instanceof PasswordHasherInterface) {
@@ -188,7 +188,7 @@ private function getHasherConfigFromAlgorithm(array $config): array
188188
$config['algorithm'] = 'native';
189189
$config['native_algorithm'] = \PASSWORD_ARGON2I;
190190
} else {
191-
throw new LogicException(sprintf('Algorithm "argon2i" is not available. Use "%s" instead.', \defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13') ? 'argon2id" or "auto' : 'auto'));
191+
throw new LogicException(\sprintf('Algorithm "argon2i" is not available. Use "%s" instead.', \defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13') ? 'argon2id" or "auto' : 'auto'));
192192
}
193193

194194
return $this->getHasherConfigFromAlgorithm($config);
@@ -200,7 +200,7 @@ private function getHasherConfigFromAlgorithm(array $config): array
200200
$config['algorithm'] = 'native';
201201
$config['native_algorithm'] = \PASSWORD_ARGON2ID;
202202
} else {
203-
throw new LogicException(sprintf('Algorithm "argon2id" is not available. Either use "%s", upgrade to PHP 7.3+ or use libsodium 1.0.15+ instead.', \defined('PASSWORD_ARGON2I') || $hasSodium ? 'argon2i", "auto' : 'auto'));
203+
throw new LogicException(\sprintf('Algorithm "argon2id" is not available. Either use "%s", upgrade to PHP 7.3+ or use libsodium 1.0.15+ instead.', \defined('PASSWORD_ARGON2I') || $hasSodium ? 'argon2i", "auto' : 'auto'));
204204
}
205205

206206
return $this->getHasherConfigFromAlgorithm($config);

Hasher/Pbkdf2PasswordHasher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function hash(#[\SensitiveParameter] string $plainPassword, ?string $salt
6666
}
6767

6868
if (!\in_array($this->algorithm, hash_algos(), true)) {
69-
throw new LogicException(sprintf('The algorithm "%s" is not supported.', $this->algorithm));
69+
throw new LogicException(\sprintf('The algorithm "%s" is not supported.', $this->algorithm));
7070
}
7171

7272
$digest = hash_pbkdf2($this->algorithm, $plainPassword, $salt ?? '', $this->iterations, $this->length, true);

0 commit comments

Comments
 (0)