From fd81fa329666781f55b7a3756e1623e32e533f07 Mon Sep 17 00:00:00 2001 From: Vasily Vostrotin Date: Mon, 27 Jan 2025 14:20:22 +0300 Subject: [PATCH] fix(keyboard): incorrect array PHPDOC declaration in Keyboard::fromArray() method cause phpstan wrong autocorrection Wrong phpstan autocorrection in commit https://github.com/defstudio/telegraph/commit/e156746b0d864185b0def79e5cdf0a31725835bb --- src/Keyboard/Keyboard.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Keyboard/Keyboard.php b/src/Keyboard/Keyboard.php index 11859d7d..3cfcb33e 100644 --- a/src/Keyboard/Keyboard.php +++ b/src/Keyboard/Keyboard.php @@ -47,7 +47,7 @@ protected function clone(): Keyboard } /** - * @param array> $arrayKeyboard + * @param array> $arrayKeyboard * * @return Keyboard */ @@ -85,11 +85,11 @@ public static function fromArray(array $arrayKeyboard): Keyboard } if (array_key_exists('switch_inline_query', $button)) { - $rowButton = $rowButton->switchInlineQuery($button['switch_inline_query']); + $rowButton = $rowButton->switchInlineQuery($button['switch_inline_query'] ?? ''); } if (array_key_exists('switch_inline_query_current_chat', $button)) { - $rowButton = $rowButton->switchInlineQuery($button['switch_inline_query_current_chat'])->currentChat(); + $rowButton = $rowButton->switchInlineQuery($button['switch_inline_query_current_chat'] ?? '')->currentChat(); } $rowButtons[] = $rowButton;