netflie / whatsapp-cloud-api

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform
https://netflie.es/portfolio/whatsapp-business-cloud-api-php-sdk/
MIT License
449 stars 163 forks source link

Initialize MessageNotification properties #114

Closed angelomelonas closed 1 year ago

angelomelonas commented 1 year ago

Description

I have noticed the following error message when calling if ($messageNotification->context() !== null) {...} (for example) recently:

Uncaught PHP Exception Symfony\Component\Messenger\Exception\HandlerFailedException: "Handling "App\My\Class\Here" failed: Typed property Netflie\WhatsAppCloudApi\WebHook\Notification\MessageNotification::$context must not be accessed before initialization"

Perhaps there is a good reason why these properties are not initialized, so feel free to reject this pull request 😄

Thanks for the awesome SDK! ❤️

avido commented 1 year ago

Can this change also be released?

aalbarca commented 1 year ago

Can this change also be released?

Done.