From 0c91dcf55fc139938ba19622042c40efaa9463e4 Mon Sep 17 00:00:00 2001 From: mbardelmeijer Date: Thu, 2 Mar 2023 08:24:26 +0000 Subject: [PATCH] Fix styling --- src/Converters/LibreOfficeConverter.php | 6 +++--- tests/DocumentReplacerTest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Converters/LibreOfficeConverter.php b/src/Converters/LibreOfficeConverter.php index 3279016..654f069 100644 --- a/src/Converters/LibreOfficeConverter.php +++ b/src/Converters/LibreOfficeConverter.php @@ -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; @@ -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); @@ -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'); } diff --git a/tests/DocumentReplacerTest.php b/tests/DocumentReplacerTest.php index 59dd51b..cb60d16 100644 --- a/tests/DocumentReplacerTest.php +++ b/tests/DocumentReplacerTest.php @@ -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',