Skip to content

Bad response throwing TypeError #17

Description

@JMStewart00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions