fix code quality, typage, php-csfixer
This commit is contained in:
@ -30,7 +30,7 @@ class PasswordEncoder implements LegacyPasswordHasherInterface
|
||||
/**
|
||||
* Pas utilisé, mais on doit le garder pour le implements
|
||||
*/
|
||||
public function hash(string $plainPassword, string $salt = null): string
|
||||
public function hash(string $plainPassword, ?string $salt = null): string
|
||||
{
|
||||
if ($this->isPasswordTooLong($plainPassword)) {
|
||||
throw new InvalidPasswordException();
|
||||
@ -39,7 +39,7 @@ class PasswordEncoder implements LegacyPasswordHasherInterface
|
||||
return hash($plainPassword.$salt, $this->hashAlgoLegacy[0]);
|
||||
}
|
||||
|
||||
public function verify(string $hashedPassword, string $plainPassword, string $salt = null): bool
|
||||
public function verify(string $hashedPassword, string $plainPassword, ?string $salt = null): bool
|
||||
{
|
||||
if ('' === $plainPassword || $this->isPasswordTooLong($plainPassword)) {
|
||||
return false;
|
||||
@ -76,10 +76,8 @@ class PasswordEncoder implements LegacyPasswordHasherInterface
|
||||
|
||||
/**
|
||||
* Retourne la string à hasher en fonction du pattern indiqué
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getPasswordToHash($plainTextPassword, $salt)
|
||||
protected function getPasswordToHash(string $plainTextPassword, ?string $salt = null): string
|
||||
{
|
||||
$arrayRef = [
|
||||
self::PASSWORD_PATTERN => $plainTextPassword,
|
||||
@ -101,7 +99,7 @@ class PasswordEncoder implements LegacyPasswordHasherInterface
|
||||
return $completedPlainPassword;
|
||||
}
|
||||
|
||||
protected function compareSsha($hashPassword, $plainPassword)
|
||||
protected function compareSsha(string $hashPassword, string $plainPassword): bool
|
||||
{
|
||||
$base_64_hash_with_salt = substr($hashPassword, 6);
|
||||
$hash_with_salt = base64_decode($base_64_hash_with_salt);
|
||||
|
Reference in New Issue
Block a user