kartik-v / yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)
http://demos.krajee.com/export
Other
165 stars 126 forks source link

Declaration of kartik\export\ExportWriterPdf::createExternalWriterInstance($config = []) not compatible with PhpSpreadsheet v2 #378

Open TonisOrmisson opened 5 months ago

TonisOrmisson commented 5 months ago

Steps to reproduce the issue

  1. Update to PhpSpreadsheet v2
  2. try to export a PDF file
  3. Not compatible Exception is thrown:

Declaration of kartik\export\ExportWriterPdf::createExternalWriterInstance($config = []) must be compatible with PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf::createExternalWriterInstance(array $config): Mpdf\Mpdf

Isolating the problem

this module: https://github.com/kartik-v/yii2-export/blob/5c033d407631f8f4aa1f47e4a53e0204d45bb29c/src/ExportWriterPdf.php#L35

parent class: https://github.com/PHPOffice/PhpSpreadsheet/blob/0c37ae2c30599819d7fab7d13ab5027ffd71f61a/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php#L22 expects (array $config) as params...

ahmadfadlydziljalal commented 4 months ago

Ya, the problem is happened to me also, For now, Do you have any solution mate ?