Passed
Push — master ( 5b5bb9...d21849 )
by Luiz Kim
02:43
created
src/Service/ExtraDataService.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,12 +32,14 @@  discard block
 block discarded – undo
32 32
     public function persistData($entity_id, $entity_name)
33 33
     {
34 34
 
35
-        if (self::$persisted == true || !$entity_id || !$entity_name)
36
-            return;
35
+        if (self::$persisted == true || !$entity_id || !$entity_name) {
36
+                    return;
37
+        }
37 38
 
38 39
         $extra_data = json_decode($this->request->getContent(), true)['extra-data'] ?? null;
39
-        if (!$extra_data)
40
-            return;
40
+        if (!$extra_data) {
41
+                    return;
42
+        }
41 43
 
42 44
 
43 45
         foreach ($extra_data['data'] as $key => $data) {
@@ -49,8 +51,9 @@  discard block
 block discarded – undo
49 51
                 'extra_fields' => $extra_fields
50 52
             ]);
51 53
 
52
-            if (!$extraData)
53
-                $extraData = new ExtraData();
54
+            if (!$extraData) {
55
+                            $extraData = new ExtraData();
56
+            }
54 57
 
55 58
             $extraData->setExtraFields($extra_fields);
56 59
             $extraData->setEntityName($entity_name);
@@ -66,8 +69,9 @@  discard block
 block discarded – undo
66 69
     public function  noChange()
67 70
     {
68 71
         $extra_data = json_decode($this->request->getContent(), true)['extra-data'] ?? null;
69
-        if (!$extra_data)
70
-            return;
72
+        if (!$extra_data) {
73
+                    return;
74
+        }
71 75
 
72 76
         $this->persistData($extra_data['entity_id'], $extra_data['entity_name']);
73 77
     }
Please login to merge, or discard this patch.
src/Listener/DefaultEventListener.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,8 +45,9 @@
 block discarded – undo
45 45
             $service = $this->container->get($serviceName);
46 46
             if (method_exists($service, $method)) {
47 47
                 $entity = $service->$method($entity);
48
-                if ('afterPersist' === $method && $entity)
49
-                    $this->manager->refresh($entity);
48
+                if ('afterPersist' === $method && $entity) {
49
+                                    $this->manager->refresh($entity);
50
+                }
50 51
             }
51 52
         }
52 53
 
Please login to merge, or discard this patch.