mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-12-17 15:45:43 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
@@ -22,6 +22,7 @@ use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
||||
/**
|
||||
* Class SetPasswordCommand.
|
||||
*/
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:user:set_password')]
|
||||
class SetPasswordCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'set a password to user';
|
||||
@@ -41,7 +42,7 @@ class SetPasswordCommand extends Command
|
||||
->findOneBy(['username' => $username]);
|
||||
}
|
||||
|
||||
public function _setPassword(User $user, $password)
|
||||
public function _setPassword(User $user, $password): void
|
||||
{
|
||||
$defaultEncoder = new \Symfony\Component\PasswordHasher\Hasher\MessageDigestPasswordHasher('sha512', true, 5000);
|
||||
$encoders = [
|
||||
@@ -54,9 +55,9 @@ class SetPasswordCommand extends Command
|
||||
$this->entityManager->flush($user);
|
||||
}
|
||||
|
||||
public function configure()
|
||||
public function configure(): void
|
||||
{
|
||||
$this->setName('chill:user:set_password')
|
||||
$this
|
||||
->addArgument('username', InputArgument::REQUIRED, 'the user\'s '
|
||||
.'username you want to change password')
|
||||
->addArgument('password', InputArgument::OPTIONAL, 'the new password');
|
||||
|
||||
Reference in New Issue
Block a user