Passed
Push — master ( 676e43...59ca63 )
by Luiz Kim
04:45 queued 02:20
created
src/Listener/DefaultEventListener.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@
 block discarded – undo
51 51
             $service = $this->container->get($serviceName);
52 52
             if (method_exists($service, $method)) {
53 53
                 $entity = $service->$method($entity);
54
-                if ('postPersist' === $method && $entity)
55
-                    $this->manager->refresh($entity);
54
+                if ('postPersist' === $method && $entity) {
55
+                                    $this->manager->refresh($entity);
56
+                }
56 57
             }
57 58
         }
58 59
     }
Please login to merge, or discard this patch.
src/Service/NotificationService.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@
 block discarded – undo
10 10
 class NotificationService
11 11
 {
12 12
 
13
-  public function __construct(
13
+    public function __construct(
14 14
     private EntityManagerInterface $manager,
15 15
     private Security               $security,
16 16
     private RequestStack $requestStack,
17 17
     private PusherService $pusher
18
-  ) {
19
-  }
18
+    ) {
19
+    }
20 20
 
21
-  public function postPersist(Notification $notification)
22
-  {
21
+    public function postPersist(Notification $notification)
22
+    {
23 23
     $this->pusher->push(['company' => 1, 'people' => 1], 'my_topic');
24
-  }
24
+    }
25 25
 }
Please login to merge, or discard this patch.
src/Service/ExtraDataService.php 2 patches
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -47,8 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
     public function persist(&$entity)
49 49
     {
50
-        if (self::$persisted == true)
51
-            return;
50
+        if (self::$persisted == true) {
51
+                    return;
52
+        }
52 53
         self::$persisted = true;
53 54
 
54 55
         //$this->manager->persist($entity);
@@ -67,15 +68,17 @@  discard block
 block discarded – undo
67 68
         } else {
68 69
             $json =       json_decode($this->request->getContent(), true);
69 70
             $extra_data = isset($json['extra-data']) ? $json['extra-data'] : null;
70
-            if (!$extra_data)
71
-                return;
71
+            if (!$extra_data) {
72
+                            return;
73
+            }
72 74
             $entity_id = $extra_data['entity_id'];
73 75
             $entity_name = $extra_data['entity_name'];
74 76
         }
75 77
 
76 78
 
77
-        if (!$entity_id || !$entity_name)
78
-            return;
79
+        if (!$entity_id || !$entity_name) {
80
+                    return;
81
+        }
79 82
 
80 83
         foreach ($extra_data['data'] as $key => $data) {
81 84
             $extra_fields = $this->manager->getRepository(ExtraFields::class)->find($key);
@@ -86,8 +89,9 @@  discard block
 block discarded – undo
86 89
                 'extra_fields' => $extra_fields
87 90
             ]);
88 91
 
89
-            if (!$extraData)
90
-                $extraData = new ExtraData();
92
+            if (!$extraData) {
93
+                            $extraData = new ExtraData();
94
+            }
91 95
 
92 96
             $extraData->setExtraFields($extra_fields);
93 97
             $extraData->setEntityName($entity_name);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 
65 65
             //$this->manager->persist($entity);
66 66
         } else {
67
-            $json =       json_decode($this->request->getContent(), true);
67
+            $json = json_decode($this->request->getContent(), true);
68 68
             $extra_data = isset($json['extra-data']) ? $json['extra-data'] : null;
69 69
             if (!$extra_data)
70 70
                 return;
Please login to merge, or discard this patch.
src/Repository/ModuleRepository.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
  */
15 15
 class ModuleRepository extends ServiceEntityRepository
16 16
 {
17
-  public function __construct(ManagerRegistry $registry)
18
-  {
17
+    public function __construct(ManagerRegistry $registry)
18
+    {
19 19
     parent::__construct($registry, Module::class);
20
-  }
20
+    }
21 21
 }
Please login to merge, or discard this patch.
src/Service/ConfigService.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@
 block discarded – undo
25 25
     public function getConfig(People $people, $key, $json = false)
26 26
     {
27 27
         $config = $this->discoveryConfig($people, $key, false);
28
-        $value =  $config ? $config->getConfigValue() : null;
28
+        $value = $config ? $config->getConfigValue() : null;
29 29
         return $json ? json_decode($value) : $value;
30 30
     }
31 31
 
32 32
     private function discoveryConfig(People $people, $key, $create = true): ?Config
33 33
     {
34
-        $config =   $this->manager->getRepository(Config::class)->findOneBy([
34
+        $config = $this->manager->getRepository(Config::class)->findOneBy([
35 35
             'people' => $people,
36 36
             'configKey' => $key
37 37
         ]);
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@  discard block
 block discarded – undo
36 36
             'people' => $people,
37 37
             'configKey' => $key
38 38
         ]);
39
-        if ($config)
40
-            return $config;
39
+        if ($config) {
40
+                    return $config;
41
+        }
41 42
         if ($create) {
42 43
             $config = new Config();
43 44
             $config->setConfigKey($key);
@@ -55,14 +56,16 @@  discard block
 block discarded – undo
55 56
     ) {
56 57
         $config = $this->discoveryConfig($people, $key);
57 58
         $newValue = json_decode($config->getConfigValue()) || [];
58
-        if (!is_array($newValue))
59
-            $newValue = [$newValue];
59
+        if (!is_array($newValue)) {
60
+                    $newValue = [$newValue];
61
+        }
60 62
 
61
-        if (is_array($values))
62
-            foreach ($values as $key => $value)
63
+        if (is_array($values)) {
64
+                    foreach ($values as $key => $value)
63 65
                 $newValue[$key] = $value;
64
-        else
65
-            $newValue[] = $values;
66
+        } else {
67
+                    $newValue[] = $values;
68
+        }
66 69
 
67 70
         $config->setConfigValue(json_encode($newValue));
68 71
         $config->setVisibility($visibility);
Please login to merge, or discard this patch.
src/Controller/AddAppConfigAction.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -18,31 +18,31 @@
 block discarded – undo
18 18
 
19 19
 class AddAppConfigAction
20 20
 {
21
-  public function __construct(
21
+    public function __construct(
22 22
     private Security $security,
23 23
     private EntityManagerInterface $manager,
24 24
     private ConfigService $configService,
25 25
     private HydratorService $hydratorService
26
-  ) {}
26
+    ) {}
27 27
 
28
-  public function __invoke(Request $request): JsonResponse
29
-  {
28
+    public function __invoke(Request $request): JsonResponse
29
+    {
30 30
     try {
31
-      $json = json_decode($request->getContent(), true);
32
-      $people = $this->manager->getRepository(People::class)->find(preg_replace("/[^0-9]/", "", $json['people']));
33
-      $module = $this->manager->getRepository(Module::class)->find(preg_replace("/[^0-9]/", "", $json['module']));
34
-      $configValue = json_decode($json['configValue']);
35
-      $config = $this->configService->addConfig(
31
+        $json = json_decode($request->getContent(), true);
32
+        $people = $this->manager->getRepository(People::class)->find(preg_replace("/[^0-9]/", "", $json['people']));
33
+        $module = $this->manager->getRepository(Module::class)->find(preg_replace("/[^0-9]/", "", $json['module']));
34
+        $configValue = json_decode($json['configValue']);
35
+        $config = $this->configService->addConfig(
36 36
         $people,
37 37
         $json['configKey'],
38 38
         is_array($configValue) ? $configValue : [$configValue],
39 39
         $module,
40 40
         $json['visibility']
41
-      );
41
+        );
42 42
 
43
-      return new JsonResponse($this->hydratorService->item(Config::class, $config->getId(), "config:read"), Response::HTTP_OK);
43
+        return new JsonResponse($this->hydratorService->item(Config::class, $config->getId(), "config:read"), Response::HTTP_OK);
44 44
     } catch (Exception $e) {
45
-      return new JsonResponse($this->hydratorService->error($e));
45
+        return new JsonResponse($this->hydratorService->error($e));
46
+    }
46 47
     }
47
-  }
48 48
 }
Please login to merge, or discard this patch.