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