Skip to content

Commit

Permalink
Use (string) $body instead of $body->getContents() for getting co…
Browse files Browse the repository at this point in the history
…ntents from StreamInterface. (#2871)

because method `getContents()` only returns the remaining contents in a string.
  • Loading branch information
limingxinleo authored Nov 25, 2020
1 parent d2a69b6 commit ce5b2a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Room/RedisNsqAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function subscribe()
try {
$response = $client->stats('json', $this->getChannelKey());
if ($response->getStatusCode() == 200) {
$json = Json::decode($response->getBody()->getContents());
$json = Json::decode((string) $response->getBody());
foreach ($json['topics'] as $topic) {
if (Arr::get($topic, 'topic_name') !== $this->getChannelKey()) {
continue;
Expand Down

0 comments on commit ce5b2a3

Please sign in to comment.