Files
oleibman 6083e393c1 Permit Read to Class Which Extends Spreadsheet
See discussion #4202. Users can extend Spreadsheet, but the readers cannot return the extended class. This is solved pretty easily by adding a protected method in BaseReader which returns a new Spreadsheet. Users can then extend the Reader which they want, overriding that method to return the extended class.
2025-03-13 12:01:33 -07:00

17 lines
329 B
PHP

<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx as XlsxReader;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
class MyXlsxReader extends XlsxReader
{
protected function newSpreadsheet(): Spreadsheet
{
return new MySpreadsheet();
}
}