Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
mbardelmeijer authored and github-actions[bot] committed Mar 2, 2023
1 parent d5f2a9f commit 0c91dcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Converters/LibreOfficeConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LibreOfficeConverter extends AbstractConverter

public function convert(string $input, string $output): void
{
$temporaryOutputDirectory = sys_get_temp_dir() . '/document-replacer-' . uniqid() . '-libreoffice';
$temporaryOutputDirectory = sys_get_temp_dir().'/document-replacer-'.uniqid().'-libreoffice';

try {
$binary = $this->options['binary'] ?? (new ExecutableFinder())->find('libreoffice') ?? static::BINARY;
Expand All @@ -31,7 +31,7 @@ public function convert(string $input, string $output): void
$binary,
'--convert-to pdf:writer_pdf_Export',
...$this->libreOfficeOptions,
'--outdir ' . escapeshellarg($temporaryOutputDirectory),
'--outdir '.escapeshellarg($temporaryOutputDirectory),
escapeshellarg($input),
]));
$process->setTimeout(20);
Expand All @@ -42,7 +42,7 @@ public function convert(string $input, string $output): void
}

// LibreOffice can not write to a file directly, so we need to move the file to the correct location.
$files = glob($temporaryOutputDirectory . "/*.pdf");
$files = glob($temporaryOutputDirectory.'/*.pdf');
if (count($files) !== 1) {
throw new ConversionFailed('Failed to convert document: more than one file was created');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/DocumentReplacerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function test_pdf_saver_via_libreoffice_converter()
$output = '/tmp/replaced-document.pdf';
file_exists($output) && unlink($output);

DocumentReplacer::template(__DIR__ . '/fixtures/template.docx')
DocumentReplacer::template(__DIR__.'/fixtures/template.docx')
->converter(LibreOfficeConverter::class)
->replace([
'${user}' => 'Michel',
Expand Down

0 comments on commit 0c91dcf

Please sign in to comment.