Passed
Push — master ( 8cc76a...2b3d01 )
by Luiz Kim
07:43 queued 05:27
created
src/Service/TaskInterationService.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,12 +40,13 @@  discard block
 block discarded – undo
40 40
 
41 41
     $file = null;
42 42
     $media = $message->getMessageContent()->getMedia();
43
-    if ($media)
44
-      $file = $this->fileService->addFile(
43
+    if ($media) {
44
+          $file = $this->fileService->addFile(
45 45
         $registredBy,
46 46
         pack("C*", ...$media->getData()),
47 47
         $type
48 48
       );
49
+    }
49 50
 
50 51
     $taskInteration = new TaskInteration();
51 52
     $taskInteration->setTask($task);
@@ -53,8 +54,9 @@  discard block
 block discarded – undo
53 54
     $taskInteration->setVisibility($visibility);
54 55
     $taskInteration->setBody($message->getMessageContent()->getBody());
55 56
     $taskInteration->setRegisteredBy($registredBy);
56
-    if ($file)
57
-      $taskInteration->setFile($file);
57
+    if ($file) {
58
+          $taskInteration->setFile($file);
59
+    }
58 60
 
59 61
     $this->manager->persist($taskInteration);
60 62
     $this->manager->flush();
@@ -91,8 +93,9 @@  discard block
 block discarded – undo
91 93
 
92 94
   public function prePersist(TaskInteration $taskInteration): TaskInteration
93 95
   {
94
-    if (!$taskInteration->getRegisteredBy())
95
-      $taskInteration->setRegisteredBy($this->security->getToken()->getUser()->getPeople());
96
+    if (!$taskInteration->getRegisteredBy()) {
97
+          $taskInteration->setRegisteredBy($this->security->getToken()->getUser()->getPeople());
98
+    }
96 99
     return  $taskInteration;
97 100
   }
98 101
 }
Please login to merge, or discard this patch.