File tree Expand file tree Collapse file tree 6 files changed +20
-9
lines changed
Expand file tree Collapse file tree 6 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 2020 }
2121 },
2222 "require" : {
23- "php" : " ^7.3|^ 8.0"
23+ "php" : " ^8.0"
2424 },
2525 "require-dev" : {
2626 "pestphp/pest" : " ^1.21" ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace PhpTelegramBot \FluentKeyboard ;
4+
5+ abstract class Button extends FluentEntity
6+ {
7+
8+ }
Original file line number Diff line number Diff line change 22
33namespace PhpTelegramBot \FluentKeyboard \InlineKeyboard ;
44
5+ use PhpTelegramBot \FluentKeyboard \Button ;
56use PhpTelegramBot \FluentKeyboard \FluentEntity ;
67
78/**
1415 * @method self callbackGame(string $callback_game)
1516 * @method self pay(bool $pay = true)
1617 */
17- class InlineKeyboardButton extends FluentEntity
18+ class InlineKeyboardButton extends Button
1819{
1920
2021 protected $ defaults = [
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function __construct(array $data = [])
2525 /**
2626 * Adds a new row to the keyboard.
2727 *
28- * @param array $buttons
28+ * @param Button[] $buttons
2929 * @return $this
3030 */
3131 public function row (array $ buttons = [])
@@ -50,7 +50,7 @@ public function row(array $buttons = [])
5050 /**
5151 * Adds buttons one per row to the keyboard.
5252 *
53- * @param array $buttons
53+ * @param Button[] $buttons
5454 * @return $this
5555 */
5656 public function stack (array $ buttons )
@@ -66,10 +66,10 @@ public function stack(array $buttons)
6666 /**
6767 * Adds a button to the last row.
6868 *
69- * @param \JsonSerializable $button
69+ * @param Button $button
7070 * @return $this
7171 */
72- public function button (\ JsonSerializable $ button )
72+ public function button (Button $ button )
7373 {
7474 $ keyboard = &$ this ->data [static ::$ keyboardFieldName ];
7575
Original file line number Diff line number Diff line change 22
33namespace PhpTelegramBot \FluentKeyboard \ReplyKeyboard ;
44
5- use PhpTelegramBot \FluentKeyboard \FluentEntity ;
5+ use PhpTelegramBot \FluentKeyboard \Button ;
66
77/**
88 * @method self text(string $text)
99 * @method self requestContact(bool $request_contact = true)
1010 * @method self requestLocation(bool $request_location = true)
1111 * @method self requestPoll(KeyboardButtonPollType|array $request_poll = [])
1212 */
13- class KeyboardButton extends FluentEntity
13+ class KeyboardButton extends Button
1414{
1515 protected $ defaults = [
1616 'request_contact ' => true ,
Original file line number Diff line number Diff line change 22
33namespace PhpTelegramBot \FluentKeyboard \ReplyKeyboard ;
44
5- class KeyboardButtonPollType implements \JsonSerializable
5+ use PhpTelegramBot \FluentKeyboard \Button ;
6+
7+ class KeyboardButtonPollType extends Button
68{
79
810 protected $ data = [];
You can’t perform that action at this time.
0 commit comments