From 961dc693d181617b1e7835c49af922ecc8ebca8c Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 5 Jul 2020 17:35:13 +0200 Subject: [PATCH] Improve SCrutinizer happiness --- src/PhpSpreadsheet/Reader/Xml.php | 4 ++-- src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/PhpSpreadsheet/Reader/Xml.php b/src/PhpSpreadsheet/Reader/Xml.php index 2f6a2160..768498c2 100644 --- a/src/PhpSpreadsheet/Reader/Xml.php +++ b/src/PhpSpreadsheet/Reader/Xml.php @@ -632,7 +632,7 @@ class Xml extends BaseReader $xml_x = $worksheet->children($namespaces['x']); if (isset($xml_x->WorksheetOptions)) { $printSettings = $this->pageSetup($xml_x, $namespaces, $this->getPrintDefaults()); - $printSettings = $this->printSetup($xml_x, $namespaces, $printSettings); + $printSettings = $this->printSetup($xml_x, $printSettings); $spreadsheet->getActiveSheet()->getPageSetup() ->setPaperSize($printSettings->paperSize) @@ -933,7 +933,7 @@ class Xml extends BaseReader return $printDefaults; } - private function printSetup(SimpleXMLElement $xmlX, array $namespaces, stdClass $printDefaults): stdClass + private function printSetup(SimpleXMLElement $xmlX, stdClass $printDefaults): stdClass { if (isset($xmlX->WorksheetOptions->Print)) { foreach ($xmlX->WorksheetOptions->Print as $printData) { diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php index 2a8a3add..759d9611 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php @@ -875,9 +875,7 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('firstPageNumber', $pSheet->getPageSetup()->getFirstPageNumber()); $objWriter->writeAttribute('useFirstPageNumber', '1'); } - if ($pSheet->getPageSetup()->getPageOrder() !== null) { - $objWriter->writeAttribute('pageOrder', $pSheet->getPageSetup()->getPageOrder()); - } + $objWriter->writeAttribute('pageOrder', $pSheet->getPageSetup()->getPageOrder()); $getUnparsedLoadedData = $pSheet->getParent()->getUnparsedLoadedData(); if (isset($getUnparsedLoadedData['sheets'][$pSheet->getCodeName()]['pageSetupRelId'])) {