@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | { |
167 | 167 | $ct_file = $this->ReadOpenXmlFile('[Content_Types].xml', 'object'); |
168 | 168 | |
169 | - if (! ($ct_file instanceof \Traversable)) { |
|
169 | + if (!($ct_file instanceof \Traversable)) { |
|
170 | 170 | throw new Exception('Cannot traverse through [Content_Types].xml.'); |
171 | 171 | } |
172 | 172 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | //if content type for jpg has not been set, add it to xml |
184 | 184 | // and save xml to file and add it to the archive |
185 | - if (! $ct_already_set) { |
|
185 | + if (!$ct_already_set) { |
|
186 | 186 | $sxe = $ct_file->addChild('Default'); |
187 | 187 | $sxe->addAttribute('Extension', $imageCt); |
188 | 188 | $sxe->addAttribute('ContentType', 'image/'.$imageCt); |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $valid = true; |
372 | 372 | |
373 | 373 | //TODO: create a better url validity check |
374 | - if (! trim(str_replace(['http', 'https', ':', ' '], '', $url)) || $url == str_replace('http', '', $url)) { |
|
374 | + if (!trim(str_replace(['http', 'https', ':', ' '], '', $url)) || $url == str_replace('http', '', $url)) { |
|
375 | 375 | $valid = false; |
376 | 376 | } |
377 | 377 | $mode = 'url'; |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | $valid = true; |
395 | 395 | |
396 | 396 | //check if path starts with storage path |
397 | - if (! starts_with($path, storage_path())) { |
|
397 | + if (!starts_with($path, storage_path())) { |
|
398 | 398 | $valid = false; |
399 | 399 | } |
400 | 400 | $mode = 'path'; |
@@ -418,14 +418,14 @@ discard block |
||
418 | 418 | { |
419 | 419 | $this->Log('Converting DOCX to PDF'); |
420 | 420 | //convert to pdf with libre office |
421 | - $command = 'soffice --headless --convert-to pdf '.str_replace(" ","\ ",$this->StoragePath($this->local_path.$this->template_file_name)).' --outdir '.$this->StoragePath($this->local_path); |
|
421 | + $command = 'soffice --headless --convert-to pdf '.str_replace(" ", "\ ", $this->StoragePath($this->local_path.$this->template_file_name)).' --outdir '.$this->StoragePath($this->local_path); |
|
422 | 422 | $process = new \Symfony\Component\Process\Process($command); |
423 | 423 | $process->start(); |
424 | 424 | while ($process->isRunning()) { |
425 | 425 | //wait until process is ready |
426 | 426 | } |
427 | 427 | // executes after the command finishes |
428 | - if (! $process->isSuccessful()) { |
|
428 | + if (!$process->isSuccessful()) { |
|
429 | 429 | throw new \Symfony\Component\Process\Exception\ProcessFailedException($process); |
430 | 430 | } else { |
431 | 431 | $path_parts = pathinfo($this->StoragePath($this->local_path.$this->template_file_name)); |