@@ -20,8 +20,9 @@ discard block |
||
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 |
||
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 |
||
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 | } |