sendgrid / sendgrid-php

The Official Twilio SendGrid PHP API Library
https://sendgrid.com
MIT License
1.49k stars 623 forks source link

chore: add php 8.0 support #1053

Closed eshanholtz closed 2 years ago

andreas-aeschlimann commented 2 years ago

Thanks for this PR. I think there is some work that needs to be done before merging, though.

We get the following warning:

<b>Fatal error</b>: During inheritance of JsonSerializable: Uncaught ErrorException: Return type of
SendGrid\Mail\Mail::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the
#[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in
/usr/share/nginx/html/vendor/sendgrid/sendgrid/lib/mail/Mail.php:1837

(Note that this is a warning that is promoted to ErrorException and it might be appearing in PHP 8.1, not sure about PHP 8.0.)

Are there any plans to support PHP 8 any time soon?

EDIT: I have added a PR myself to address this issue.