php-excel-templator icon indicating copy to clipboard operation
php-excel-templator copied to clipboard

PhpSpreadsheet introduced a breaking change in 1.13.0

Open alexey-m-ukolov opened this issue 4 years ago • 3 comments

They've changed the signature of public function insertNewBefore($pBefore, $pNumCols, $pNumRows, Worksheet $pSheet) by adding return type hint of void.

This projects should add a version restriction for the library:

"require": {
  "phpoffice/phpspreadsheet": ">=1.4 <1.13"
}

Meanwhile problem can be solved by composer require phpoffice/phpspreadsheet:1.12.* in one's own project which will override the broken version.

alexey-m-ukolov avatar Jun 05 '20 08:06 alexey-m-ukolov

Hi. I updated the phpspreadsheet to latest (1.13). Nothing broke. Is it really breaks down? The return type void can't break it because the method did not return anything before.

alhimik1986 avatar Jun 17 '20 08:06 alhimik1986

You probably have notices disabled in your error reporting.

Your class extends the class from phpoffice/phpspreadsheet which has a return type hint, so your class should have it too - so the method signature would be the same.

alexey-m-ukolov avatar Jun 18 '20 13:06 alexey-m-ukolov

Anyway, 1.0.11 fixes it.

alexey-m-ukolov avatar Jun 18 '20 13:06 alexey-m-ukolov