Passed
Push — master ( d35b2f...d29be9 )
by Luiz Kim
02:18
created
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.
src/Service/TaskInterationService.php 1 patch
Braces   +15 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,12 +45,13 @@  discard block
 block discarded – undo
45 45
 
46 46
     $file = null;
47 47
     $media = $message->getMessageContent()->getMedia();
48
-    if ($media)
49
-      $file = $this->fileService->addFile(
48
+    if ($media) {
49
+          $file = $this->fileService->addFile(
50 50
         $registredBy,
51 51
         pack("C*", ...$media->getData()),
52 52
         $type
53 53
       );
54
+    }
54 55
 
55 56
     $taskInteration = new TaskInteration();
56 57
     $taskInteration->setTask($task);
@@ -58,8 +59,9 @@  discard block
 block discarded – undo
58 59
     $taskInteration->setVisibility($visibility);
59 60
     $taskInteration->setBody($message->getMessageContent()->getBody());
60 61
     $taskInteration->setRegisteredBy($registredBy);
61
-    if ($file)
62
-      $taskInteration->setFile($file);
62
+    if ($file) {
63
+          $taskInteration->setFile($file);
64
+    }
63 65
 
64 66
     $this->manager->persist($taskInteration);
65 67
     $this->manager->flush();
@@ -87,7 +89,9 @@  discard block
 block discarded – undo
87 89
       $task->settype($type);
88 90
     }
89 91
 
90
-    if ($announce) $task->addAnnounce($announce);
92
+    if ($announce) {
93
+        $task->addAnnounce($announce);
94
+    }
91 95
     $task->setTaskStatus($openStatus);
92 96
     $this->manager->persist($task);
93 97
     $this->manager->flush();
@@ -97,7 +101,9 @@  discard block
 block discarded – undo
97 101
 
98 102
   public function notifyClient(TaskInteration $taskInteration): TaskInteration
99 103
   {
100
-    if (!$this->notify) return $taskInteration;
104
+    if (!$this->notify) {
105
+        return $taskInteration;
106
+    }
101 107
     $task = $taskInteration->getTask();
102 108
     $origin = "551131360353";
103 109
 
@@ -119,8 +125,9 @@  discard block
 block discarded – undo
119 125
 
120 126
   public function prePersist(TaskInteration $taskInteration): TaskInteration
121 127
   {
122
-    if (!$taskInteration->getRegisteredBy())
123
-      $taskInteration->setRegisteredBy($this->security->getToken()->getUser()->getPeople());
128
+    if (!$taskInteration->getRegisteredBy()) {
129
+          $taskInteration->setRegisteredBy($this->security->getToken()->getUser()->getPeople());
130
+    }
124 131
     return  $taskInteration;
125 132
   }
126 133
 
Please login to merge, or discard this patch.