Passed
Push — master ( d9ee28...02f370 )
by Luiz Kim
02:19
created
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.