mail-mime-parser icon indicating copy to clipboard operation
mail-mime-parser copied to clipboard

PHP 8.1 deprecation notices

Open alexei-bykovski opened this issue 2 years ago • 3 comments

Hello. I use the last version of lib 2.2.1 and have deprecation notices.

  1. Method "SplSubject::attach()" might add "void" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Message\MessagePart" now to avoid errors or add an explicit @return annotation to suppress this message.
  2. Method "SplSubject::detach()" might add "void" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Message\MessagePart" now to avoid errors or add an explicit @return annotation to suppress this message.
  3. Method "SplSubject::notify()" might add "void" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Message\MessagePart" now to avoid errors or add an explicit @return annotation to suppress this message.
  4. The "ZBateson\MailMimeParser\Message::setHtmlPart()" method will require a new "string $contentTypeCharset" argument in the next major version of its interface "ZBateson\MailMimeParser\IMessage", not defining it is deprecated.
  5. Method "SplObserver::update()" might add "void" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Parser\Part\ParserPartStreamContainer" now to avoid errors or add an explicit @return annotation to suppress this message.
  6. Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Message\PartChildrenContainer" now to avoid errors or add an explicit @return annotation to suppress this message.
  7. Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Message\PartChildrenContainer" now to avoid errors or add an explicit @return annotation to suppress this message.
  8. Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Message\PartChildrenContainer" now to avoid errors or add an explicit @return annotation to suppress this message.
  9. Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Message\PartChildrenContainer" now to avoid errors or add an explicit @return annotation to suppress this message.
  10. Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Parser\Part\ParserPartChildrenContainer" now to avoid errors or add an explicit @return annotation to suppress this message.
  11. Method "SplObserver::update()" might add "void" as a native return type declaration in the future. Do the same in implementation "ZBateson\MailMimeParser\Stream\MessagePartStream" now to avoid errors or add an explicit @return annotation to suppress this message.
  12. Method "Psr\Http\Message\StreamInterface::close()" might add "void" as a native return type declaration in the future. Do the same in implementation "ZBateson\StreamDecorators\NonClosingStream" now to avoid errors or add an explicit @return annotation to suppress this message.

Could you please fix all these notices please? Thank you.

alexei-bykovski avatar Jun 29 '22 08:06 alexei-bykovski

Hi @alexei-bykovski --

If you feel like submitting a pull request with "@return" annotations to fix it, I'd approve it. Otherwise, not entirely sure when I'll get around to this.

All the best

zbateson avatar Jul 06 '22 21:07 zbateson

Hi @zbateson. I also noticed that there is already a commit that should have fixed the problem (added #[\ReturnTypeWillChange] attribute), but it doesn't work for me. I have PHP 8.1.1 🤷. This commit [(https://github.com/zbateson/mail-mime-parser/commit/123dc3a41fa18999881349270e1a8eaade7f266f)]. But "@return" annotations work. I checked. So if you don't mind I can make a pull request with the replacing #[\ReturnTypeWillChange] attributes to "@return" annotations.

alexei-bykovski avatar Jul 07 '22 10:07 alexei-bykovski

Yeah, that would be great, thank you!

zbateson avatar Jul 11 '22 21:07 zbateson

Hi @zbateson. Please merge pull request https://github.com/zbateson/mail-mime-parser/pull/197. Thank you.

alexei-bykovski avatar Aug 31 '22 12:08 alexei-bykovski

Merged

alexei-bykovski avatar Sep 01 '22 16:09 alexei-bykovski