@@ -30,8 +30,9 @@ discard block |
||
30 | 30 | public function genetateFromModel(Contract $data) |
31 | 31 | { |
32 | 32 | $file = $data->getContractFile(); |
33 | - if (!$file) |
|
34 | - $file = new File(); |
|
33 | + if (!$file) { |
|
34 | + $file = new File(); |
|
35 | + } |
|
35 | 36 | |
36 | 37 | $file->setFileType('text'); |
37 | 38 | $file->setExtension('html'); |
@@ -47,8 +48,9 @@ discard block |
||
47 | 48 | { |
48 | 49 | $content = $contract->getContractFile()->getContent(); |
49 | 50 | |
50 | - if ($contract->getContractFile()->getExtension() == 'pdf') |
|
51 | - return $content; |
|
51 | + if ($contract->getContractFile()->getExtension() == 'pdf') { |
|
52 | + return $content; |
|
53 | + } |
|
52 | 54 | |
53 | 55 | if (empty($content)) { |
54 | 56 | throw new \Exception( |