telegraph
telegraph copied to clipboard
Error in Keyboard::fromArray() method if InlineKeyboardButton button has empty query string
Fix for my previous PR https://github.com/defstudio/telegraph/issues/533
Hi,
If I send message with 2 buttons:
- InlineKeyboardButton with empty string query = ''
- KeyboardButton
Than try to press KeyboardButton, Telegram send this CallbackQuery array to my webhook:
As you can see, switch_inline_query_current_chat=null instead of empty string. Telegram swap empty string with null value.
It causes error DefStudio\Telegraph\Keyboard\Button::switchInlineQuery(): Argument #1 ($switchInlineQuery) must be of type string, null given, called in .../vendor/defstudio/telegraph/src/Keyboard/Keyboard.php on line 92
I made a PR. Is it OK to not add unit tests for this fix?