Passed
Push — master ( ff3fed...973f06 )
by Luiz Kim
02:24
created
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/CreateUserAction.php 1 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/ChangePasswordAction.php 1 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/SecurityController.php 1 patch
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.
src/Controller/CreateAccountAction.php 1 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.