From 13ec1633337e657e80e1ca2063da90853e0cb1b5 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sat, 8 May 2021 21:04:13 +0200 Subject: [PATCH] phpstan appeasement --- src/PhpSpreadsheet/Reader/Gnumeric/Styles.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php b/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php index 270f0728..3ee57f41 100644 --- a/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php +++ b/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php @@ -106,7 +106,7 @@ class Styles } $styleAttributes = $style->attributes(); - if (($styleAttributes['startRow'] <= $maxRow) && ($styleAttributes['startCol'] <= $maxCol)) { + if ($styleAttributes !== null && ($styleAttributes['startRow'] <= $maxRow) && ($styleAttributes['startCol'] <= $maxCol)) { $cellRange = $this->readStyleRange($styleAttributes, $maxCol, $maxRow); $styleAttributes = $style->Style->attributes(); @@ -258,7 +258,7 @@ class Styles } } - private function readStyleRange(?SimpleXMLElement $styleAttributes, int $maxCol, int $maxRow): string + private function readStyleRange(SimpleXMLElement $styleAttributes, int $maxCol, int $maxRow): string { $startColumn = Coordinate::stringFromColumnIndex((int) $styleAttributes['startCol'] + 1); $startRow = $styleAttributes['startRow'] + 1;