Skip to content

Conversation

@mattdinthehouse
Copy link
Contributor

@mattdinthehouse mattdinthehouse commented Sep 7, 2023

The MimePart class implements Psr\Http\Message\MessageInterface via guzzlehttp/guzzle which was recently updated with added return types that cause a "method is not compatible" type error in MimePart

This PR adds those return types to MimePart so it'll work on PHP 8

All the calling code expects MimePart::getBody() to return a string but now it returns a StreamInterface so I've updated the calling code in this library to use a new MimePart::getBodyString() method - if downstream users depend on strings then use this newer method to get them

… of psr/http-message that has return types which causes a Fatal Error on PHP 8; Add a MimePart::getBodyString() helper method that converts MimePart::getBody()'s StreamInterface into a string and update all the calling code for MimePart::getBody() over to MimePart::getBodyString()
@tiamo
Copy link
Owner

tiamo commented Sep 9, 2023

@mattdinthehouse Thanks! Looks good 👍

@tiamo tiamo merged commit c1cbd2c into tiamo:master Sep 9, 2023
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.

2 participants