@@ -12,8 +12,9 @@ discard block |
||
12 | 12 | public function __construct(private EntityManagerInterface $manager, private UserPasswordEncoderInterface $encoder) {} |
13 | 13 | public function changePassword(User $user, $password) |
14 | 14 | { |
15 | - if (!$this->getPermission()) |
|
16 | - throw new Exception("You should not pass!!!", 301); |
|
15 | + if (!$this->getPermission()) { |
|
16 | + throw new Exception("You should not pass!!!", 301); |
|
17 | + } |
|
17 | 18 | |
18 | 19 | $user->setHash( |
19 | 20 | $this->encoder->encodePassword($user, $password) |
@@ -26,8 +27,9 @@ discard block |
||
26 | 27 | |
27 | 28 | public function createUser($people_id, $username, $password) |
28 | 29 | { |
29 | - if (!$this->getPermission()) |
|
30 | - throw new Exception("You should not pass!!!", 301); |
|
30 | + if (!$this->getPermission()) { |
|
31 | + throw new Exception("You should not pass!!!", 301); |
|
32 | + } |
|
31 | 33 | |
32 | 34 | $user = new User(); |
33 | 35 | $user->setPeople($this->manager->getRepository(User::class)->find($people_id)); |