Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)

This commit is contained in:
Kevin Papst
2022-12-31 21:19:55 +01:00
committed by GitHub
parent 95e06746bd
commit 90a0fd8a22
2164 changed files with 83700 additions and 86426 deletions

View File

@@ -9,9 +9,9 @@
namespace App\Invoice\Renderer;
use App\Entity\InvoiceDocument;
use App\Invoice\InvoiceModel;
use App\Invoice\RendererInterface;
use App\Model\InvoiceDocument;
use PhpOffice\PhpWord\Escaper\Xml;
use PhpOffice\PhpWord\Exception\Exception as OfficeException;
use PhpOffice\PhpWord\Settings;
@@ -21,11 +21,6 @@ use Symfony\Component\HttpFoundation\Response;
final class DocxRenderer extends AbstractRenderer implements RendererInterface
{
/**
* @param InvoiceDocument $document
* @param InvoiceModel $model
* @return Response
*/
public function render(InvoiceDocument $document, InvoiceModel $model): Response
{
Settings::setOutputEscapingEnabled(false);
@@ -46,9 +41,7 @@ final class DocxRenderer extends AbstractRenderer implements RendererInterface
try {
$template->cloneRow('entry.row', \count($model->getCalculator()->getEntries()));
} catch (OfficeException $ex) {
@trigger_error(
sprintf('Invoice document (%s) did not contain a clone row, was that on purpose?', $document->getFilename())
);
@trigger_error('Invoice document did not contain a clone row, was that on purpose?');
}
}
@@ -73,18 +66,12 @@ final class DocxRenderer extends AbstractRenderer implements RendererInterface
return $this->getFileResponse(new Stream($cacheFile), $filename);
}
/**
* @return string[]
*/
protected function getFileExtensions()
protected function getFileExtensions(): array
{
return ['.docx'];
}
/**
* @return string
*/
protected function getContentType()
protected function getContentType(): string
{
return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
}