Passed
Push — master ( 2c1550...32625a )
by Luiz Kim
23:24 queued 21:04
created
src/Service/SignatureService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         }
134 134
 
135 135
         $contractProviders = $contract->getPeoples()
136
-            ->filter(function ($contractPeople) {
136
+            ->filter(function($contractPeople) {
137 137
                 return $contractPeople->getPeopleType() == 'Beneficiary';
138 138
             });
139 139
         if ($contractProviders->isEmpty()) {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         }
148 148
 
149 149
         $contractParticipants = $contract->getPeoples()
150
-            ->filter(function ($contractPeople) {
150
+            ->filter(function($contractPeople) {
151 151
                 return $contractPeople->getPeopleType() != 'Beneficiary';
152 152
             });
153 153
         if ($contractParticipants->isEmpty()) {
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     protected function getContractContractorSignerName(Contract $contract): string
167 167
     {
168 168
         $contractPayers = $contract->getPeoples()
169
-            ->filter(function ($contractPeople) {
169
+            ->filter(function($contractPeople) {
170 170
                 return $contractPeople->getPeopleType() == 'Contractor';
171 171
             });
172 172
         if ($contractPayers->isEmpty()) {
Please login to merge, or discard this patch.
src/Service/ContractService.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,17 +11,17 @@  discard block
 block discarded – undo
11 11
 class ContractService
12 12
 {
13 13
 
14
-  public function __construct(
14
+    public function __construct(
15 15
     private EntityManagerInterface $manager,
16 16
     private PdfService $pdf,
17 17
     private ModelService $modelService
18
-  ) {}
18
+    ) {}
19 19
 
20
-  public function genetateFromModel(Contract $data)
21
-  {
20
+    public function genetateFromModel(Contract $data)
21
+    {
22 22
     $file = $data->getContractFile();
23 23
     if (!$file)
24
-      $file = new File();
24
+        $file = new File();
25 25
 
26 26
     $file->setFileType('text');
27 27
     $file->setExtension('html');
@@ -33,35 +33,35 @@  discard block
 block discarded – undo
33 33
 
34 34
     $data->setContractFile($file);
35 35
     $data->setStatus($this->manager->getRepository(Status::class)->findOneBy([
36
-      'realStatus' => 'open',
37
-      'context' => $data->getStatus()->getContext()
36
+        'realStatus' => 'open',
37
+        'context' => $data->getStatus()->getContext()
38 38
     ]));
39 39
     $this->manager->persist($data);
40 40
     $this->manager->flush();
41 41
 
42 42
     return $data;
43
-  }
43
+    }
44 44
 
45
-  public function getContractPDFContent(Contract $contract): string
46
-  {
45
+    public function getContractPDFContent(Contract $contract): string
46
+    {
47 47
     $content = $contract->getContractFile()->getContent();
48 48
 
49 49
     if ($contract->getContractFile()->getExtension() == 'pdf')
50
-      return $content;
50
+        return $content;
51 51
 
52 52
     if (empty($content)) {
53
-      throw new \Exception(
53
+        throw new \Exception(
54 54
         sprintf('Houve um erro ao gerar o PDF')
55
-      );
55
+        );
56 56
     }
57 57
 
58 58
     return $this->pdf->convertHtmlToPdf($content);
59
-  }
59
+    }
60 60
 
61 61
 
62
-  public function postPersist(Contract $contract)
63
-  {
62
+    public function postPersist(Contract $contract)
63
+    {
64 64
     if ($contract->getStatus()->getRealStatus() == 'open')
65
-      return  $this->genetateFromModel($contract);
66
-  }
65
+        return  $this->genetateFromModel($contract);
66
+    }
67 67
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@  discard block
 block discarded – undo
20 20
   public function genetateFromModel(Contract $data)
21 21
   {
22 22
     $file = $data->getContractFile();
23
-    if (!$file)
24
-      $file = new File();
23
+    if (!$file) {
24
+          $file = new File();
25
+    }
25 26
 
26 27
     $file->setFileType('text');
27 28
     $file->setExtension('html');
@@ -46,8 +47,9 @@  discard block
 block discarded – undo
46 47
   {
47 48
     $content = $contract->getContractFile()->getContent();
48 49
 
49
-    if ($contract->getContractFile()->getExtension() == 'pdf')
50
-      return $content;
50
+    if ($contract->getContractFile()->getExtension() == 'pdf') {
51
+          return $content;
52
+    }
51 53
 
52 54
     if (empty($content)) {
53 55
       throw new \Exception(
@@ -61,7 +63,8 @@  discard block
 block discarded – undo
61 63
 
62 64
   public function postPersist(Contract $contract)
63 65
   {
64
-    if ($contract->getStatus()->getRealStatus() == 'open')
65
-      return  $this->genetateFromModel($contract);
66
+    if ($contract->getStatus()->getRealStatus() == 'open') {
67
+          return  $this->genetateFromModel($contract);
68
+    }
66 69
   }
67 70
 }
Please login to merge, or discard this patch.
src/Service/ContractPeopleService.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@
 block discarded – undo
11 11
 class ContractPeopleService
12 12
 {
13 13
 
14
-  public function __construct(
14
+    public function __construct(
15 15
     private EntityManagerInterface $manager,
16 16
     private ContractService $contractService
17
-  ) {}
17
+    ) {}
18 18
 
19
-  public function postPersist(ContractPeople $contractPeople)
20
-  {
19
+    public function postPersist(ContractPeople $contractPeople)
20
+    {
21 21
     $contract = $contractPeople->getContract();
22 22
     $this->contractService->genetateFromModel($contract);
23 23
     return  $contractPeople;
24
-  }
24
+    }
25 25
 }
Please login to merge, or discard this patch.