diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Chart.php b/src/PhpSpreadsheet/Writer/Xlsx/Chart.php index ca16557a88..06a4fd90a7 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Chart.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Chart.php @@ -325,7 +325,7 @@ private function writePlotArea(XMLWriter $objWriter, ?PlotArea $plotArea, ?Title $chartTypes = self::getChartType($plotArea); $catIsMultiLevelSeries = $valIsMultiLevelSeries = false; - $plotGroupingType = ''; + $plotGroupingType = null; $chartType = null; foreach ($chartTypes as $chartType) { $objWriter->startElement('c:' . $chartType); @@ -367,7 +367,7 @@ private function writePlotArea(XMLWriter $objWriter, ?PlotArea $plotArea, ?Title $objWriter->writeAttribute('val', '150'); $objWriter->endElement(); - if ($plotGroupingType == 'percentStacked' || $plotGroupingType == 'stacked') { + if ($plotGroupingType === 'percentStacked' || $plotGroupingType === 'stacked') { $objWriter->startElement('c:overlap'); $objWriter->writeAttribute('val', '100'); $objWriter->endElement(); @@ -1110,9 +1110,9 @@ private function writePlotSeriesValuesElement(XMLWriter $objWriter, int $val, ?C * @param string $groupType Type of plot for dataseries * @param bool $catIsMultiLevelSeries Is category a multi-series category * @param bool $valIsMultiLevelSeries Is value set a multi-series set - * @param string $plotGroupingType Type of grouping for multi-series values + * @param string|null $plotGroupingType Type of grouping for multi-series values */ - private function writePlotGroup(?DataSeries $plotGroup, string $groupType, XMLWriter $objWriter, bool &$catIsMultiLevelSeries, bool &$valIsMultiLevelSeries, string &$plotGroupingType): void + private function writePlotGroup(?DataSeries $plotGroup, string $groupType, XMLWriter $objWriter, bool &$catIsMultiLevelSeries, bool &$valIsMultiLevelSeries, ?string &$plotGroupingType): void { if ($plotGroup === null) { return;