Passed
Push — master ( c12d7d...b67deb )
by Luiz Kim
01:53
created
src/Repository/UserRepository.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@
 block discarded – undo
28 28
     public function updatePassword(string $email, string $password): ?User
29 29
     {
30 30
         if ($user = $this->findOneByEmail($email)) {
31
-          $user->setPassword($password);
31
+            $user->setPassword($password);
32 32
 
33
-          $this->getEntityManager()->persist($user);
33
+            $this->getEntityManager()->persist($user);
34 34
 
35
-          $this->getEntityManager()->flush();
35
+            $this->getEntityManager()->flush();
36 36
 
37
-          return $user;
37
+            return $user;
38 38
         }
39 39
     }
40 40
 
Please login to merge, or discard this patch.
src/Controller/Oauth/DefaultClientController.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -95,10 +95,11 @@  discard block
 block discarded – undo
95 95
             ->findOneBy([
96 96
                 'username'       => $ownerDetails->getEmail(),
97 97
             ]);
98
-        if (!$user)
99
-
98
+        if (!$user) {
99
+        
100 100
 
101 101
             $user = $this->createUser($ownerDetails);
102
+        }
102 103
 
103 104
 
104 105
 
@@ -122,20 +123,23 @@  discard block
 block discarded – undo
122 123
         try {
123 124
 
124 125
 
125
-            if ($request->get('code'))
126
-                $token = $this->provider->getAccessToken('authorization_code', [
126
+            if ($request->get('code')) {
127
+                            $token = $this->provider->getAccessToken('authorization_code', [
127 128
                     'code' => $request->get('code')
128 129
                 ]);
130
+            }
129 131
 
130
-            if ($request->get('access_token'))
131
-                $token = new AccessToken([
132
+            if ($request->get('access_token')) {
133
+                            $token = new AccessToken([
132 134
                     'access_token' => $request->get('access_token'),
133 135
                 ]);
136
+            }
134 137
 
135
-            if ($request->get('code'))
136
-                $token = $this->provider->getAccessToken('authorization_code', [
138
+            if ($request->get('code')) {
139
+                            $token = $this->provider->getAccessToken('authorization_code', [
137 140
                     'code' => $request->get('code')
138 141
                 ]);
142
+            }
139 143
 
140 144
 
141 145
             $data = $this->discoveryUser($token);
@@ -164,8 +168,9 @@  discard block
 block discarded – undo
164 168
     {
165 169
         $peopleEmployee = $user->getPeople()->getPeopleCompany()->first();
166 170
 
167
-        if ($peopleEmployee !== false && $peopleEmployee->getCompany() instanceof People)
168
-            return $peopleEmployee->getCompany();
171
+        if ($peopleEmployee !== false && $peopleEmployee->getCompany() instanceof People) {
172
+                    return $peopleEmployee->getCompany();
173
+        }
169 174
     }
170 175
 
171 176
     private function getCompanyId(User $user)
Please login to merge, or discard this patch.
src/Controller/CreateUserAction.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @var Request
28 28
      */
29
-    private $request  = null;
29
+    private $request = null;
30 30
 
31 31
     /**
32 32
      * Security
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 
110 110
             $user = new User();
111 111
             $user->setUsername($payload['username']);
112
-            $user->setHash    ($this->encoder->encodePassword($user, $payload['password']));
113
-            $user->setPeople  ($company);
112
+            $user->setHash($this->encoder->encodePassword($user, $payload['password']));
113
+            $user->setPeople($company);
114 114
 
115 115
             $this->manager->persist($user);
116 116
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                 throw new \InvalidArgumentException('Deve existir pelo menos um usuário');
145 145
             }
146 146
 
147
-            $user    = $this->manager->getRepository(User::class)->findOneBy(['id' => $payload['id'], 'people' => $company]);
147
+            $user = $this->manager->getRepository(User::class)->findOneBy(['id' => $payload['id'], 'people' => $company]);
148 148
             if (!$user instanceof User) {
149 149
                 throw new \InvalidArgumentException('Person user was not found');
150 150
             }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     private function getUsers(Person $person, ?array $payload = null): array
168 168
     {
169 169
         $members = [];
170
-        $company = $this->manager->getRepository(People::class )->find($person->getId());
170
+        $company = $this->manager->getRepository(People::class)->find($person->getId());
171 171
         $users   = $this->manager->getRepository(User::class)->findBy(['people' => $company]);
172 172
 
173 173
         foreach ($users as $user) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -122,8 +122,9 @@  discard block
 block discarded – undo
122 122
             ];
123 123
 
124 124
         } catch (\Exception $e) {
125
-            if ($this->manager->getConnection()->isTransactionActive())
126
-                $this->manager->getConnection()->rollBack();
125
+            if ($this->manager->getConnection()->isTransactionActive()) {
126
+                            $this->manager->getConnection()->rollBack();
127
+            }
127 128
 
128 129
             throw new \InvalidArgumentException($e->getMessage());
129 130
         }
@@ -157,8 +158,9 @@  discard block
 block discarded – undo
157 158
             return true;
158 159
 
159 160
         } catch (\Exception $e) {
160
-            if ($this->manager->getConnection()->isTransactionActive())
161
-                $this->manager->getConnection()->rollBack();
161
+            if ($this->manager->getConnection()->isTransactionActive()) {
162
+                            $this->manager->getConnection()->rollBack();
163
+            }
162 164
 
163 165
             throw new \InvalidArgumentException($e->getMessage());
164 166
         }
Please login to merge, or discard this patch.