westacks / telebot

Easy way to create Telegram bots in PHP
https://westacks.github.io/telebot/
MIT License
282 stars 44 forks source link

fix Typed property must not be accessed before initialization error in UpdateRequest class with 7.4+ #47

Closed DyarWeb closed 2 years ago

DyarWeb commented 2 years ago

Since PHP 7.4 introduces type-hinting for properties, it is particularly important to provide valid values for all properties, so that all properties have values that match their declared types. A property that has never been assigned doesn't have a null value, but it is on an undefined state, which will never match any declared type. undefined !== null. so we can not check the status of a property in this way: !$this->update

punyflash commented 2 years ago

That's correct. Thanks!