Skip to content

Commit f0e8590

Browse files
committed
Fix some service injection
1 parent d74ae24 commit f0e8590

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Command/AddUserCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AddUserCommand extends Command
5656

5757
public function __construct(
5858
private EntityManagerInterface $entityManager,
59-
private UserPasswordEncoderInterface $passwordEncoder,
59+
private UserPasswordHasherInterface $passwordHasher,
6060
private Validator $validator,
6161
private UserRepository $users
6262
) {
@@ -181,7 +181,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
181181
$user->setEmail($email);
182182
$user->setRoles([$isAdmin ? 'ROLE_ADMIN' : 'ROLE_USER']);
183183

184-
// See https://symfony.com/doc/current/security.html#c-encoding-passwords
184+
// See https://symfony.com/doc/5.4/security.html#registering-the-user-hashing-passwords
185185
$hashedPassword = $this->passwordHasher->hashPassword($user, $plainPassword);
186186
$user->setPassword($hashedPassword);
187187

src/DataFixtures/AppFixtures.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class AppFixtures extends Fixture
2525
{
2626
public function __construct(
27-
private UserPasswordEncoderInterface $passwordEncoder,
27+
private UserPasswordHasherInterface $passwordHasher,
2828
private SluggerInterface $slugger
2929
) {
3030
}

0 commit comments

Comments
 (0)