Passed
Push — master ( 34e91e...8ddd25 )
by Luiz Kim
02:42
created
src/Service/UserService.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
27 28
 
28 29
   public function changeApiKey(User $user)
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->generateApiKey();
34 36
 
@@ -39,8 +41,9 @@  discard block
 block discarded – undo
39 41
 
40 42
   public function createUser(People $people, $username, $password)
41 43
   {
42
-    if (!$this->getPermission())
43
-      throw new Exception("You should not pass!!!", 301);
44
+    if (!$this->getPermission()) {
45
+          throw new Exception("You should not pass!!!", 301);
46
+    }
44 47
 
45 48
     $user = new User();
46 49
     $user->setPeople($people);
Please login to merge, or discard this patch.