diff --git a/CHANGELOG.PHPExcel.md b/CHANGELOG.PHPExcel.md index c92feda9..3c299020 100644 --- a/CHANGELOG.PHPExcel.md +++ b/CHANGELOG.PHPExcel.md @@ -1518,7 +1518,7 @@ documentation for more information on entering dates into a cell. ### Bugfixes - PHPExcel->removeSheetByIndex now re-orders sheets after deletion, so no array indexes are lost - @JV -- PHPExcel_Writer_Excel2007_Worksheet::_writeCols() used direct assignment to $pSheet->getColumnDimension('A')->Width instead of ~~~~$pSheet->getColumnDimension('A')->setWidth() - @JV +- PHPExcel_Writer_Excel2007_Worksheet::_writeCols() used direct assignment to $pSheet->getColumnDimension('A')->Width instead of $pSheet->getColumnDimension('A')->setWidth() - @JV - DocumentProperties used $this->LastModifiedBy instead of $this->_lastModifiedBy. - @JV ### General diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index f9c4fc0c..15bb8100 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -4724,7 +4724,7 @@ class Calculation } } else { if ($pCell === null) { - // We can't access the cell, so return a REF error + // We can't access the cell, so return a REF error $cellValue = Functions::REF(); } else { $cellRef = $matches[6] . $matches[7]; @@ -5307,7 +5307,6 @@ class Calculation $returnValue = []; if ($worksheet !== null) { - $worksheetName = $worksheet->getTitle(); if (strpos($range, '!') !== false) { [$worksheetName, $range] = Worksheet::extractSheetTitle($range, true); $worksheet = $this->spreadsheet->getSheetByName($worksheetName); diff --git a/src/PhpSpreadsheet/Cell/Coordinate.php b/src/PhpSpreadsheet/Cell/Coordinate.php index 33b0c214..df64c557 100644 --- a/src/PhpSpreadsheet/Cell/Coordinate.php +++ b/src/PhpSpreadsheet/Cell/Coordinate.php @@ -156,24 +156,24 @@ abstract class Coordinate /** * Build range from coordinate strings. * - * @param array $rangea Array containg one or more arrays containing one or two coordinate strings + * @param array $range Array containing one or more arrays containing one or two coordinate strings * * @return string String representation of $pRange */ - public static function buildRange(array $rangea) + public static function buildRange(array $range) { // Verify range - if (empty($rangea) || !is_array($rangea[0])) { + if (empty($range) || !is_array($range[0])) { throw new Exception('Range does not contain any information'); } // Build range - $counter = count($rangea); + $counter = count($range); for ($i = 0; $i < $counter; ++$i) { - $rangea[$i] = implode(':', $rangea[$i]); + $range[$i] = implode(':', $range[$i]); } - return implode(',', $rangea); + return implode(',', $range); } /** diff --git a/src/PhpSpreadsheet/Reader/Csv.php b/src/PhpSpreadsheet/Reader/Csv.php index e0f2c451..50426c4f 100644 --- a/src/PhpSpreadsheet/Reader/Csv.php +++ b/src/PhpSpreadsheet/Reader/Csv.php @@ -427,19 +427,6 @@ class Csv extends BaseReader return $this->escapeCharacter; } - /** - * Scrutinizer believes, incorrectly, that the specific pathinfo - * call in canRead can return something other than an array. - * Phpstan knows better. - * This function satisfies both. - * - * @param mixed $extension - */ - private static function extractStringLower($extension): string - { - return is_string($extension) ? strtolower($extension) : ''; - } - /** * Can the current IReader read the file? */ diff --git a/src/PhpSpreadsheet/Shared/Drawing.php b/src/PhpSpreadsheet/Shared/Drawing.php index 04ce1430..1d2a1537 100644 --- a/src/PhpSpreadsheet/Shared/Drawing.php +++ b/src/PhpSpreadsheet/Shared/Drawing.php @@ -143,7 +143,7 @@ class Drawing */ public static function angleToDegrees($angle) { - $pValue = (int) $angle; + $angle = (int) $angle; if ($angle != 0) { return (int) round($angle / 60000); } diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Chart.php b/src/PhpSpreadsheet/Writer/Xlsx/Chart.php index e65f6e34..8cefe4cc 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Chart.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Chart.php @@ -75,7 +75,7 @@ class Chart extends WriterPart $objWriter->writeAttribute('val', 0); $objWriter->endElement(); - $this->writePlotArea($objWriter, $pChart->getWorksheet(), $pChart->getPlotArea(), $pChart->getXAxisLabel(), $pChart->getYAxisLabel(), $pChart->getChartAxisX(), $pChart->getChartAxisY(), $pChart->getMajorGridlines(), $pChart->getMinorGridlines()); + $this->writePlotArea($objWriter, $pChart->getPlotArea(), $pChart->getXAxisLabel(), $pChart->getYAxisLabel(), $pChart->getChartAxisX(), $pChart->getChartAxisY(), $pChart->getMajorGridlines(), $pChart->getMinorGridlines()); $this->writeLegend($objWriter, $pChart->getLegend()); @@ -202,7 +202,7 @@ class Chart extends WriterPart * @param Axis $xAxis * @param Axis $yAxis */ - private function writePlotArea(XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet, PlotArea $plotArea, ?Title $xAxisLabel = null, ?Title $yAxisLabel = null, ?Axis $xAxis = null, ?Axis $yAxis = null, ?GridLines $majorGridlines = null, ?GridLines $minorGridlines = null): void + private function writePlotArea(XMLWriter $objWriter, PlotArea $plotArea, ?Title $xAxisLabel = null, ?Title $yAxisLabel = null, ?Axis $xAxis = null, ?Axis $yAxis = null, ?GridLines $majorGridlines = null, ?GridLines $minorGridlines = null): void { if ($plotArea === null) { return;