genkgo / mail

Library to send e-mails over different transports and protocols (like SMTP and IMAP) using immutable messages and streams. Also includes SMTP server.
https://mail.readthedocs.io/
Other
402 stars 21 forks source link

Adapt AddressList.php::getIterator to suppress deprecation warning #99

Closed k00ni closed 2 years ago

k00ni commented 2 years ago

I am using this library in a PHP 8.1 project. When running PHPUnit, it shows the following deprecation message:

Deprecated: Return type of Genkgo\Mail\AddressList::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/genkgo/mail/src/AddressList.php on line 96

This fix should get rid of this message without introducing a breaking change. You may have plans to solve this issue in the future.

k00ni commented 2 years ago

Please let me know if there is anything left to do to get this merged.

frederikbosch commented 2 years ago

Thanks, I added the return type, rather than added the annotation. Also thanks for the other PR. I created a tag, so you should be able to use this now.