Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made compatible with PHP 8.4 #4248

Closed
wants to merge 5 commits into from
Closed

Conversation

jeremyvaught
Copy link

Please take note of our contributing guidelines: https://docs.laravel-excel.com/3.1/getting-started/contributing.html
Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.

1️⃣ Why should it be added? What are the benefits of this change?
The benefit of this change is that PHP 8.4 is now released, and this package is dead in the water on 8.4 without a fix.

2️⃣ Does it contain multiple, unrelated changes? Please separate the PRs out.
Well, I did add the ability to run the tests in SQLite in memory. But it's the first commit, so if this change is offensive, please delete it.

3️⃣ Does it include tests, if possible?
This is not a new feature, so no new tests were added. But the tests are all green. I even removed all of the PHPUnit warnings and deprecations. All set for PHPUnit 12.

4️⃣ Any drawbacks? Possible breaking changes?
Nope, this was artisinally delivered.

5️⃣ Mark the following tasks as done:

  • [ x] Checked the codebase to ensure that your feature doesn't already exist.
  • [ x] Take note of the contributing guidelines.
  • [ x] Checked the pull requests to ensure that another person hasn't already submitted a fix.
  • [ x] Added tests to ensure against regression.

6️⃣ Thanks for contributing! 🙌

Pleasure doing business with you.

@jeremyvaught
Copy link
Author

Well, heck, I didn't test if it works back to the last decade. Also, I suspect that your CI is expecting only MySQL and not the oh-so-speedy SQLite, that everything is failing.

@patrickbrouwers
Copy link
Member

patrickbrouwers commented Nov 23, 2024

and this package is dead in the water on 8.4 without a fix.

Are you sure? I've ran the entire test suite on PHP 8.4: https://github.com/SpartnerNL/Laravel-Excel/actions/runs/11986377646/job/33419367162 and I don't get any failures or warnings in CI.

If there's any deprecation warnings, we'll need to have a look at how to apply it backwards compatible. I'm open to switch to SQlite, but I'd prefer to do it in a separate PR so we just focus on getting 8.4 compatible first. Then do any improvements that are needed for sqlite, phpunit12 etc.

@MeiKatz
Copy link

MeiKatz commented Nov 24, 2024

When I try to install the package via composer with PHP 8.4.1 I get the following list of deprecation warnings:

PHP Deprecated:  Maatwebsite\Excel\Excel::download(): Implicitly marking parameter $writerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 82
PHP Deprecated:  Maatwebsite\Excel\Excel::store(): Implicitly marking parameter $diskName as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 102
PHP Deprecated:  Maatwebsite\Excel\Excel::store(): Implicitly marking parameter $writerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 102
PHP Deprecated:  Maatwebsite\Excel\Excel::store(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 102
PHP Deprecated:  Maatwebsite\Excel\Excel::queue(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 123
PHP Deprecated:  Maatwebsite\Excel\Excel::queue(): Implicitly marking parameter $writerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 123
PHP Deprecated:  Maatwebsite\Excel\Excel::import(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 152
PHP Deprecated:  Maatwebsite\Excel\Excel::import(): Implicitly marking parameter $readerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 152
PHP Deprecated:  Maatwebsite\Excel\Excel::toArray(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 167
PHP Deprecated:  Maatwebsite\Excel\Excel::toArray(): Implicitly marking parameter $readerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 167
PHP Deprecated:  Maatwebsite\Excel\Excel::toCollection(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 177
PHP Deprecated:  Maatwebsite\Excel\Excel::toCollection(): Implicitly marking parameter $readerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 177
PHP Deprecated:  Maatwebsite\Excel\Excel::queueImport(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 187
PHP Deprecated:  Maatwebsite\Excel\Excel::queueImport(): Implicitly marking parameter $readerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 187
PHP Deprecated:  Maatwebsite\Excel\Excel::export(): Implicitly marking parameter $writerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Excel.php on line 200
PHP Deprecated:  Maatwebsite\Excel\Exporter::download(): Implicitly marking parameter $writerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Exporter.php on line 17
PHP Deprecated:  Maatwebsite\Excel\Exporter::store(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Exporter.php on line 30
PHP Deprecated:  Maatwebsite\Excel\Exporter::store(): Implicitly marking parameter $writerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Exporter.php on line 30
PHP Deprecated:  Maatwebsite\Excel\Exporter::queue(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Exporter.php on line 40
PHP Deprecated:  Maatwebsite\Excel\Exporter::queue(): Implicitly marking parameter $writerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Exporter.php on line 40
PHP Deprecated:  Maatwebsite\Excel\Importer::import(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Importer.php on line 17
PHP Deprecated:  Maatwebsite\Excel\Importer::import(): Implicitly marking parameter $readerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Importer.php on line 17
PHP Deprecated:  Maatwebsite\Excel\Importer::toArray(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Importer.php on line 26
PHP Deprecated:  Maatwebsite\Excel\Importer::toArray(): Implicitly marking parameter $readerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Importer.php on line 26
PHP Deprecated:  Maatwebsite\Excel\Importer::toCollection(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Importer.php on line 35
PHP Deprecated:  Maatwebsite\Excel\Importer::toCollection(): Implicitly marking parameter $readerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Importer.php on line 35
PHP Deprecated:  Maatwebsite\Excel\Importer::queueImport(): Implicitly marking parameter $disk as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Importer.php on line 44
PHP Deprecated:  Maatwebsite\Excel\Importer::queueImport(): Implicitly marking parameter $readerType as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vendor/maatwebsite/excel/src/Importer.php on line 44

@patrickbrouwers
Copy link
Member

I merged #4251 as that seems the non-breaking way of supporting it.
Feel free to create a PR for other improvements like sqlite, I'll close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants