rector fixes + bug fixes

This commit is contained in:
Dennis Eichhorn 2023-05-27 03:06:46 +00:00
parent 4f50728503
commit 577f423c6a
3 changed files with 10 additions and 10 deletions

View File

@ -73,7 +73,7 @@ final class Installer extends InstallerAbstract
{ {
try { try {
$app->dbPool->get()->con->query('select 1 from `editor_doc`'); $app->dbPool->get()->con->query('select 1 from `editor_doc`');
} catch (\Exception $e) { } catch (\Exception $_) {
return []; // @codeCoverageIgnore return []; // @codeCoverageIgnore
} }

View File

@ -17,8 +17,8 @@ use phpOMS\Utils\Parser\Markdown\Markdown;
/** @var \phpOMS\Views\View $this */ /** @var \phpOMS\Views\View $this */
require_once $this->getData('defaultTemplates') require_once $this->getData('defaultTemplates')
->findFile('.pdf.php') ->findFile('.pdf.php')
->getAbsolutePath(); ->getAbsolutePath();
/** @var \Modules\Editor\Models\EditorDoc $doc */ /** @var \Modules\Editor\Models\EditorDoc $doc */
$doc = $this->getData('doc') ?? new NullEditorDoc(); $doc = $this->getData('doc') ?? new NullEditorDoc();

View File

@ -17,8 +17,8 @@ use phpOMS\Utils\Parser\Markdown\Markdown;
/** @var \phpOMS\Views\View $this */ /** @var \phpOMS\Views\View $this */
require_once $this->getData('defaultTemplates') require_once $this->getData('defaultTemplates')
->findFile('.pdf.php') ->findFile('.pdf.php')
->getAbsolutePath(); ->getAbsolutePath();
/** @var \Modules\Editor\Models\EditorDoc $doc */ /** @var \Modules\Editor\Models\EditorDoc $doc */
$doc = $this->getData('doc') ?? new NullEditorDoc(); $doc = $this->getData('doc') ?? new NullEditorDoc();
@ -28,9 +28,9 @@ $doc = $this->getData('doc') ?? new NullEditorDoc();
$pdf = new DefaultPdf(); $pdf = new DefaultPdf();
$pdf->setHeaderData( $pdf->setHeaderData(
$this->getData('defaultTemplates')->findFile('logo.png')->getAbsolutePath(), 15, $this->getData('defaultTemplates')->findFile('logo.png')->getAbsolutePath(), 15,
$this->getData('logo_name') ?? 'Jingga', $this->getData('logo_name') ?? 'Jingga',
$this->getData('slogan') ?? 'Business solutions made simple.' $this->getData('slogan') ?? 'Business solutions made simple.'
); );
$pdf->setCreator($this->getData('creator') ?? 'Jingga'); $pdf->setCreator($this->getData('creator') ?? 'Jingga');
$pdf->setAuthor($this->getData('creator') ?? 'Jingga'); $pdf->setAuthor($this->getData('creator') ?? 'Jingga');
@ -67,6 +67,6 @@ $pdf->writeHTML(Markdown::parse($doc->plain));
//Close and output PDF document //Close and output PDF document
$pdf->Output( $pdf->Output(
$this->getData('path') ?? ($doc->createdAt->format('Y-m-d') . '_' . $doc->id . '.pdf'), $this->getData('path') ?? ($doc->createdAt->format('Y-m-d') . '_' . $doc->id . '.pdf'),
'I' 'I'
); );