Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Donatello-za opened this issue Mar 15, 2018 · 0 comments

Comments

@Donatello-za
Copy link
Contributor

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;
Donatello-za added a commit to Donatello-za/bunny that referenced this issue May 10, 2018
…exceptions.

Unsetting properties on non-dynamic classes causes all sorts of potential problems.
jakubkulhan added a commit that referenced this issue May 10, 2018
Fixed Issue #62: Modified unset() statement which lead to exceptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant