tiamo / phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard.
43 stars 43 forks source link

Add return types to MimePart so it works on PHP 8 with the newer version of psr/http-message #42

Closed mattdinthehouse closed 1 year ago

mattdinthehouse commented 1 year ago

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

tiamo commented 1 year ago

@mattdinthehouse Thanks! Looks good 👍