Passed
Push — master ( b73a64...9b2d66 )
by Luiz Kim
02:21
created
src/Service/TaskInterationService.php 1 patch
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,12 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
     $file = null;
44 44
     $media = $message->getMessageContent()->getMedia();
45
-    if ($media)
46
-      $file = $this->fileService->addFile(
45
+    if ($media) {
46
+          $file = $this->fileService->addFile(
47 47
         $registredBy,
48 48
         pack("C*", ...$media->getData()),
49 49
         $type
50 50
       );
51
+    }
51 52
 
52 53
     $taskInteration = new TaskInteration();
53 54
     $taskInteration->setTask($task);
@@ -55,8 +56,9 @@  discard block
 block discarded – undo
55 56
     $taskInteration->setVisibility($visibility);
56 57
     $taskInteration->setBody($message->getMessageContent()->getBody());
57 58
     $taskInteration->setRegisteredBy($registredBy);
58
-    if ($file)
59
-      $taskInteration->setFile($file);
59
+    if ($file) {
60
+          $taskInteration->setFile($file);
61
+    }
60 62
 
61 63
     $this->manager->persist($taskInteration);
62 64
     $this->manager->flush();
@@ -84,7 +86,9 @@  discard block
 block discarded – undo
84 86
       $task->settype($type);
85 87
     }
86 88
 
87
-    if ($announce) $task->addAnnounce($announce);
89
+    if ($announce) {
90
+        $task->addAnnounce($announce);
91
+    }
88 92
     $task->setTaskStatus($openStatus);
89 93
     $this->manager->persist($task);
90 94
     $this->manager->flush();
@@ -116,8 +120,9 @@  discard block
 block discarded – undo
116 120
 
117 121
   public function prePersist(TaskInteration $taskInteration): TaskInteration
118 122
   {
119
-    if (!$taskInteration->getRegisteredBy())
120
-      $taskInteration->setRegisteredBy($this->security->getToken()->getUser()->getPeople());
123
+    if (!$taskInteration->getRegisteredBy()) {
124
+          $taskInteration->setRegisteredBy($this->security->getToken()->getUser()->getPeople());
125
+    }
121 126
     return  $taskInteration;
122 127
   }
123 128
 
Please login to merge, or discard this patch.
src/Entity/Task.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -301,16 +301,18 @@
 block discarded – undo
301 301
     {
302 302
         $announce = $this->getAnnounce(true);
303 303
         
304
-        if (!in_array($value, $announce))
305
-            array_push($announce, $value);
304
+        if (!in_array($value, $announce)) {
305
+                    array_push($announce, $value);
306
+        }
306 307
 
307 308
         return $this->setAnnounce($announce);
308 309
     }
309 310
 
310 311
     public function setAnnounce(string|array|object $announce): self
311 312
     {
312
-        if (is_string($announce))
313
-            $announce = json_decode($announce, true);
313
+        if (is_string($announce)) {
314
+                    $announce = json_decode($announce, true);
315
+        }
314 316
 
315 317
         $this->announce = json_encode($announce);
316 318
         return $this;
Please login to merge, or discard this patch.