Apply rector rules: symfony up to 54

This commit is contained in:
2024-04-04 23:30:25 +02:00
parent 1ee3b9e2f0
commit 579bd829f8
204 changed files with 974 additions and 2346 deletions

View File

@@ -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;
}
}