jakubkulhan/bunny

Bug in onFrameReceived() function in Channel.php, $client property unset

Donatello-za opened this issue · 0 comments

When disconnecting a client, e.g. $client->disconnect() or $channel->close() the client property is unset in the onFrameReceived() function in Channel.php, see here.

This causes the exception below when subsequent calls are made to $channel->getClient() after a client have been disconnected:

PHP Notice:  Undefined property: Bunny\Channel::$client in /home/vagrant/projects/gateways/vendor/bunny/bunny/src/Bunny/Channel.php on line 118

I think that instead of unsetting the property, e.g.,

unset($this->client);

it should simply be set to null

$this->client = null;