From e7388a5cab1529c9bc3252aeb853b7c6d6f72f55 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Sat, 2 Nov 2024 04:21:06 +0100 Subject: [PATCH] Add note about hashed password Fix base mail Cleanup --- Fixture/UserFixture.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Fixture/UserFixture.php b/Fixture/UserFixture.php index 01a7e8a..2437a8d 100644 --- a/Fixture/UserFixture.php +++ b/Fixture/UserFixture.php @@ -26,12 +26,12 @@ class UserFixture extends Fixture { /** * Config array */ - protected array $config; + private array $config; /** * Air fixtures constructor */ - public function __construct(protected ContainerInterface $container, protected UserPasswordHasherInterface $hasher) { + public function __construct(private ContainerInterface $container, private UserPasswordHasherInterface $hasher) { //Retrieve config $this->config = $container->getParameter(RapsysUserBundle::getAlias()); } @@ -81,7 +81,7 @@ class UserFixture extends Fixture { [ 'civility' => 'Mister', 'group' => 'Admin', - 'mail' => 'admin@example.com', + 'mail' => 'contact@example.com', 'forename' => 'Forename', 'surname' => 'Surname', 'password' => 'test', @@ -93,7 +93,7 @@ class UserFixture extends Fixture { $users = []; foreach($userTree as $userData) { $user = new $this->config['class']['user']($userData['mail'], $userData['password'], $civilitys[$userData['civility']], $userData['forename'], $userData['surname'], $userData['active']); - #TODO: check that password is hashed correctly !!! + //XXX: required to store a hashed password $user->setPassword($this->hasher->hashPassword($user, $userData['password'])); $user->addGroup($groups[$userData['group']]); $manager->persist($user); -- 2.41.1