Skip to content

Commit b184b32

Browse files
committed
Apply code suggestion
1 parent f050b86 commit b184b32

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/PhpSpreadsheet/Writer/Xlsx/Drawing.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -614,21 +614,9 @@ private function getPassThroughDrawingXml(\PhpOffice\PhpSpreadsheet\Worksheet\Wo
614614
}
615615

616616
$codeName = $worksheet->getCodeName();
617-
if (!isset($unparsedLoadedData['sheets'][$codeName])) {
618-
return null;
619-
}
620-
621-
$sheetData = $unparsedLoadedData['sheets'][$codeName];
622-
if (!is_array($sheetData)) {
623-
return null;
624-
}
625-
617+
$sheetData = $unparsedLoadedData['sheets'][$codeName] ?? null;
626618
// Only use pass-through XML if the Reader flag was explicitly enabled
627-
if (($sheetData['drawingPassThroughEnabled'] ?? false) !== true) {
628-
return null;
629-
}
630-
631-
if (!isset($sheetData['Drawings']) || !is_array($sheetData['Drawings'])) {
619+
if (!is_array($sheetData) || ($sheetData['drawingPassThroughEnabled'] ?? false) !== true || !is_array($sheetData['Drawings'] ?? null)) {
632620
return null;
633621
}
634622

0 commit comments

Comments
 (0)