Skip to content

Commit

Permalink
Reader/Gnumeric Failure with PHP8 (PHPOffice#1662)
Browse files Browse the repository at this point in the history
* Reader/Gnumeric Failure with PHP8

An explicit cast from SimpleXML to int is now needed with PHP8,
where it was performed implicitly with PHP7.
Unit tests run correctly for both PHP7 and PHP8 on corrected code.
  • Loading branch information
oleibman authored and Gianluca Giovinazzo committed Dec 14, 2020
1 parent ae6c285 commit 91cdec8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PhpSpreadsheet/Reader/Gnumeric.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,8 @@ public function loadIntoExisting(string $pFilename, Spreadsheet $spreadsheet): S

$endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol'];
$endColumn = Coordinate::stringFromColumnIndex($endColumn + 1);
$endRow = 1 + (($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']);

$endRow = 1 + (($styleAttributes['endRow'] > $maxRow) ? $maxRow : (int) $styleAttributes['endRow']);
$cellRange = $startColumn . $startRow . ':' . $endColumn . $endRow;

$styleAttributes = $styleRegion->Style->attributes();
Expand Down

0 comments on commit 91cdec8

Please sign in to comment.