Passed
Push — master ( 29ebf0...453dcc )
by Luiz Kim
20:50 queued 18:36
created
src/Controller/Oauth/InstagramController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $this->provider = new Instagram([
28 28
             'clientId'     => $this->clientId,
29 29
             'clientSecret' => $this->clientSecret,
30
-            'redirectUri'  => 'https://' .$this->domainService->getMainDomain() . '/oauth/instagram/return',
30
+            'redirectUri'  => 'https://' . $this->domainService->getMainDomain() . '/oauth/instagram/return',
31 31
             //'hostedDomain' => 'example.com', // optional; used to restrict access to users on your G Suite/Instagram Apps for Business accounts
32 32
         ]);
33 33
     }
Please login to merge, or discard this patch.
src/Controller/ChangePasswordAction.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
   {
24 24
 
25 25
     try {
26
-      $payload   = json_decode($request->getContent());
26
+      $payload = json_decode($request->getContent());
27 27
 
28 28
       $user = $this->service->changePassword($data, $payload->password);
29 29
 
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -12,38 +12,38 @@
 block discarded – undo
12 12
 class ChangePasswordAction
13 13
 {
14 14
 
15
-  public function __construct(
15
+    public function __construct(
16 16
     private EntityManagerInterface $manager,
17 17
     private UserService $service,
18 18
     private HydratorService $hydratorService
19 19
 
20
-  ) {}
20
+    ) {}
21 21
 
22
-  public function __invoke(User $data, Request $request)
23
-  {
22
+    public function __invoke(User $data, Request $request)
23
+    {
24 24
 
25 25
     try {
26
-      $payload   = json_decode($request->getContent());
26
+        $payload   = json_decode($request->getContent());
27 27
 
28
-      $user = $this->service->changePassword($data, $payload->password);
28
+        $user = $this->service->changePassword($data, $payload->password);
29 29
 
30
-      return new JsonResponse(
30
+        return new JsonResponse(
31 31
         $this->hydratorService->item(
32
-          User::class,
33
-          $user->getId(),
34
-          "user:read"
32
+            User::class,
33
+            $user->getId(),
34
+            "user:read"
35 35
         )
36
-      );
36
+        );
37 37
     } catch (\Exception $e) {
38 38
 
39
-      return new JsonResponse([
39
+        return new JsonResponse([
40 40
         'response' => [
41
-          'data'    => [],
42
-          'count'   => 0,
43
-          'error'   => $e->getMessage(),
44
-          'success' => false,
41
+            'data'    => [],
42
+            'count'   => 0,
43
+            'error'   => $e->getMessage(),
44
+            'success' => false,
45 45
         ],
46
-      ], 500);
46
+        ], 500);
47
+    }
47 48
     }
48
-  }
49 49
 }
Please login to merge, or discard this patch.
src/Controller/CreateUserAction.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
   {
25 25
 
26 26
     try {
27
-      $payload   = json_decode($request->getContent());
28
-      $people =  $this->manager->getRepository(People::class)->find($payload->people);
27
+      $payload = json_decode($request->getContent());
28
+      $people = $this->manager->getRepository(People::class)->find($payload->people);
29 29
 
30 30
       $user = $this->service->createUser(
31 31
         $people,
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -13,43 +13,43 @@
 block discarded – undo
13 13
 class CreateUserAction
14 14
 {
15 15
 
16
-  public function __construct(
16
+    public function __construct(
17 17
     private EntityManagerInterface $manager,
18 18
     private UserService $service,
19 19
     private HydratorService $hydratorService
20 20
 
21
-  ) {}
21
+    ) {}
22 22
 
23
-  public function __invoke(Request $request)
24
-  {
23
+    public function __invoke(Request $request)
24
+    {
25 25
 
26 26
     try {
27
-      $payload   = json_decode($request->getContent());
28
-      $people =  $this->manager->getRepository(People::class)->find($payload->people);
27
+        $payload   = json_decode($request->getContent());
28
+        $people =  $this->manager->getRepository(People::class)->find($payload->people);
29 29
 
30
-      $user = $this->service->createUser(
30
+        $user = $this->service->createUser(
31 31
         $people,
32 32
         $payload->username,
33 33
         $payload->password
34
-      );
34
+        );
35 35
 
36
-      return new JsonResponse(
36
+        return new JsonResponse(
37 37
         $this->hydratorService->item(
38
-          User::class,
39
-          $user->getId(),
40
-          "user:read"
38
+            User::class,
39
+            $user->getId(),
40
+            "user:read"
41 41
         )
42
-      );
42
+        );
43 43
     } catch (\Exception $e) {
44 44
 
45
-      return new JsonResponse([
45
+        return new JsonResponse([
46 46
         'response' => [
47
-          'data'    => [],
48
-          'count'   => 0,
49
-          'error'   => $e->getMessage(),
50
-          'success' => false,
47
+            'data'    => [],
48
+            'count'   => 0,
49
+            'error'   => $e->getMessage(),
50
+            'success' => false,
51 51
         ],
52
-      ], 500);
52
+        ], 500);
53
+    }
53 54
     }
54
-  }
55 55
 }
Please login to merge, or discard this patch.
src/Controller/ChangeApiKeyAction.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,37 +11,37 @@
 block discarded – undo
11 11
 class ChangeApiKeyAction
12 12
 {
13 13
 
14
-  public function __construct(
14
+    public function __construct(
15 15
     private EntityManagerInterface $manager,
16 16
     private UserService $service,
17 17
     private HydratorService $hydratorService
18 18
 
19
-  ) {}
19
+    ) {}
20 20
 
21
-  public function __invoke(User $data)
22
-  {
21
+    public function __invoke(User $data)
22
+    {
23 23
 
24 24
     try {
25 25
 
26
-      $user = $this->service->changeApiKey($data);
26
+        $user = $this->service->changeApiKey($data);
27 27
 
28
-      return new JsonResponse(
28
+        return new JsonResponse(
29 29
         $this->hydratorService->item(
30
-          User::class,
31
-          $user->getId(),
32
-          "user:read"
30
+            User::class,
31
+            $user->getId(),
32
+            "user:read"
33 33
         )
34
-      );
34
+        );
35 35
     } catch (\Exception $e) {
36 36
 
37
-      return new JsonResponse([
37
+        return new JsonResponse([
38 38
         'response' => [
39
-          'data'    => [],
40
-          'count'   => 0,
41
-          'error'   => $e->getMessage(),
42
-          'success' => false,
39
+            'data'    => [],
40
+            'count'   => 0,
41
+            'error'   => $e->getMessage(),
42
+            'success' => false,
43 43
         ],
44
-      ], 500);
44
+        ], 500);
45
+    }
45 46
     }
46
-  }
47 47
 }
Please login to merge, or discard this patch.
src/Controller/Oauth/DefaultClientController.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,20 +34,23 @@
 block discarded – undo
34 34
         try {
35 35
 
36 36
 
37
-            if ($request->get('code'))
38
-                $token = $this->provider->getAccessToken('authorization_code', [
37
+            if ($request->get('code')) {
38
+                            $token = $this->provider->getAccessToken('authorization_code', [
39 39
                     'code' => $request->get('code')
40 40
                 ]);
41
+            }
41 42
 
42
-            if ($request->get('access_token'))
43
-                $token = new AccessToken([
43
+            if ($request->get('access_token')) {
44
+                            $token = new AccessToken([
44 45
                     'access_token' => $request->get('access_token'),
45 46
                 ]);
47
+            }
46 48
 
47
-            if ($request->get('code'))
48
-                $token = $this->provider->getAccessToken('authorization_code', [
49
+            if ($request->get('code')) {
50
+                            $token = $this->provider->getAccessToken('authorization_code', [
49 51
                     'code' => $request->get('code')
50 52
                 ]);
53
+            }
51 54
 
52 55
             $ownerDetails = $this->provider->getResourceOwner($token);
53 56
 
Please login to merge, or discard this patch.
src/Controller/SecurityController.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,25 +14,25 @@
 block discarded – undo
14 14
 {
15 15
 
16 16
 
17
-  public function __construct(
17
+    public function __construct(
18 18
     private PeopleRoleService $roleService,
19 19
     private EntityManagerInterface $manager,
20 20
     protected UserService $userService
21
-  ) {}
21
+    ) {}
22 22
 
23
-  public function __invoke(Request $request)
24
-  {
23
+    public function __invoke(Request $request)
24
+    {
25 25
     /**
26 26
      * @var \ControleOnline\Entity\User
27 27
      */
28 28
     $user = $this->getUser();
29 29
 
30 30
     if ($user === null)
31
-      return $this->json([
31
+        return $this->json([
32 32
         'error' => 'User not found'
33
-      ]);
33
+        ]);
34 34
 
35 35
     return $this->json($this->userService->getUserSession($user));
36 36
 
37
-  }
37
+    }
38 38
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,10 +27,11 @@
 block discarded – undo
27 27
      */
28 28
     $user = $this->getUser();
29 29
 
30
-    if ($user === null)
31
-      return $this->json([
30
+    if ($user === null) {
31
+          return $this->json([
32 32
         'error' => 'User not found'
33 33
       ]);
34
+    }
34 35
 
35 36
     return $this->json($this->userService->getUserSession($user));
36 37
 
Please login to merge, or discard this patch.
src/Controller/CreateAccountAction.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
   {
25 25
 
26 26
     try {
27
-      $payload   = json_decode($request->getContent());
28
-      $people =  $this->service->discoveryPeople($payload->email, $payload->name);
27
+      $payload = json_decode($request->getContent());
28
+      $people = $this->service->discoveryPeople($payload->email, $payload->name);
29 29
 
30 30
       $user = $this->service->getUserSession($this->service->createUser(
31 31
         $people,
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -13,43 +13,43 @@
 block discarded – undo
13 13
 class CreateAccountAction
14 14
 {
15 15
 
16
-  public function __construct(
16
+    public function __construct(
17 17
     private EntityManagerInterface $manager,
18 18
     private UserService $service,
19 19
     private HydratorService $hydratorService
20 20
 
21
-  ) {}
21
+    ) {}
22 22
 
23
-  public function __invoke(Request $request)
24
-  {
23
+    public function __invoke(Request $request)
24
+    {
25 25
 
26 26
     try {
27
-      $payload   = json_decode($request->getContent());
28
-      $people =  $this->service->discoveryPeople($payload->email, $payload->name);
27
+        $payload   = json_decode($request->getContent());
28
+        $people =  $this->service->discoveryPeople($payload->email, $payload->name);
29 29
 
30
-      $user = $this->service->getUserSession($this->service->createUser(
30
+        $user = $this->service->getUserSession($this->service->createUser(
31 31
         $people,
32 32
         $payload->email,
33 33
         $payload->password
34
-      ));
34
+        ));
35 35
 
36
-      return new JsonResponse([
36
+        return new JsonResponse([
37 37
         'response' => [
38
-          'data'    => $user,
39
-          'count'   => 1,
40
-          'success' => true,
38
+            'data'    => $user,
39
+            'count'   => 1,
40
+            'success' => true,
41 41
         ],
42
-      ]);
42
+        ]);
43 43
     } catch (\Exception $e) {
44 44
 
45
-      return new JsonResponse([
45
+        return new JsonResponse([
46 46
         'response' => [
47
-          'data'    => [],
48
-          'count'   => 0,
49
-          'error'   => $e->getMessage(),
50
-          'success' => false,
47
+            'data'    => [],
48
+            'count'   => 0,
49
+            'error'   => $e->getMessage(),
50
+            'success' => false,
51 51
         ],
52
-      ], 500);
52
+        ], 500);
53
+    }
53 54
     }
54
-  }
55 55
 }
Please login to merge, or discard this patch.
src/Security/TokenAuthenticator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@
 block discarded – undo
42 42
         }
43 43
 
44 44
         return new Passport(
45
-            new UserBadge($apiToken, function ($apiToken) {
45
+            new UserBadge($apiToken, function($apiToken) {
46 46
                 return $this->em->getRepository(User::class)->findOneBy(['apiKey' => $apiToken]);
47 47
             }),
48 48
             new CustomCredentials(
49
-                function ($credentials, UserInterface $user) {
49
+                function($credentials, UserInterface $user) {
50 50
                     return true;
51 51
                 },
52 52
                 $apiToken
Please login to merge, or discard this patch.