bschmitt / laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages
MIT License
268 stars 86 forks source link

array_key_exists() expects parameter 2 to be array, null given in Context.php line 76 #64

Closed alupuleasa closed 5 years ago

alupuleasa commented 5 years ago

Hello,

Function getProperty() from laravel-amqp/src/Context.php on line 63 returns null when array_key_exists returns false . I suggest to modify:

return array_key_exists($key, $this->properties) ? $this->properties[$key] : null; to return array_key_exists($key, $this->properties) ? $this->properties[$key] : [];

to avoid

array_key_exists() expects parameter 2 to be array, null given in Context.php line 76

stevenklar commented 5 years ago

Hi @alupuleasa

thank you for this suggestion. Your'e welcome to patch this in a pull request. I would be pleased to review and apply it.

Regards Steven

alupuleasa commented 5 years ago

Hi @stevenklar I've made a pull request.

Thank you, Andrei

stevenklar commented 5 years ago

Merged in Release 2.0.6 - Thank you for the contribution. ;-)