I've been getting some issues with the $responseData from sendNotifications on line 286 of the NotificationManager.php and the issue seems to be stemming from $responseData = json_decode($response->getBody()->read(1024), true);. Not sure exactly what's going on but it's chunking out a random string of the middle of an error message.
Would it be better to use Guzzle's getContents() or even substitute (string) using PHP's string casting operations, it will read all the data from the stream from the beginning until the end is reached.
I got it working regardless of success/error by using $responseData = json_decode((string) $response->getBody(), true);
Is it best practice to do this? Why or why not? And, if so, why exactly is the current code breaking? And should we change this? Thanks in advance.
I've been getting some issues with the
$responseData
fromsendNotifications
on line 286 of the NotificationManager.php and the issue seems to be stemming from$responseData = json_decode($response->getBody()->read(1024), true);
. Not sure exactly what's going on but it's chunking out a random string of the middle of an error message.Would it be better to use Guzzle's
getContents()
or even substitute(string)
using PHP's string casting operations, it will read all the data from the stream from the beginning until the end is reached.I got it working regardless of success/error by using
$responseData = json_decode((string) $response->getBody(), true);
Is it best practice to do this? Why or why not? And, if so, why exactly is the current code breaking? And should we change this? Thanks in advance.