mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
Apply rector rules: symfony up to 54
This commit is contained in:
@@ -18,13 +18,14 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
||||
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
|
||||
|
||||
/**
|
||||
* Class SetPasswordCommand.
|
||||
*/
|
||||
class SetPasswordCommand extends Command
|
||||
{
|
||||
protected static $defaultDescription = 'set a password to user';
|
||||
|
||||
/**
|
||||
* SetPasswordCommand constructor.
|
||||
*/
|
||||
@@ -42,7 +43,7 @@ class SetPasswordCommand extends Command
|
||||
|
||||
public function _setPassword(User $user, $password)
|
||||
{
|
||||
$defaultEncoder = new MessageDigestPasswordEncoder('sha512', true, 5000);
|
||||
$defaultEncoder = new \Symfony\Component\PasswordHasher\Hasher\MessageDigestPasswordHasher('sha512', true, 5000);
|
||||
$encoders = [
|
||||
User::class => $defaultEncoder,
|
||||
];
|
||||
@@ -56,7 +57,6 @@ class SetPasswordCommand extends Command
|
||||
public function configure()
|
||||
{
|
||||
$this->setName('chill:user:set_password')
|
||||
->setDescription('set a password to user')
|
||||
->addArgument('username', InputArgument::REQUIRED, 'the user\'s '
|
||||
.'username you want to change password')
|
||||
->addArgument('password', InputArgument::OPTIONAL, 'the new password');
|
||||
@@ -80,6 +80,6 @@ class SetPasswordCommand extends Command
|
||||
|
||||
$this->_setPassword($user, $password);
|
||||
|
||||
return 0;
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user