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 20
20
}
21
21
},
22
22
"require" : {
23
- "php" : " ^7.3|^ 8.0"
23
+ "php" : " ^8.0"
24
24
},
25
25
"require-dev" : {
26
26
"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 2
2
3
3
namespace PhpTelegramBot \FluentKeyboard \InlineKeyboard ;
4
4
5
+ use PhpTelegramBot \FluentKeyboard \Button ;
5
6
use PhpTelegramBot \FluentKeyboard \FluentEntity ;
6
7
7
8
/**
14
15
* @method self callbackGame(string $callback_game)
15
16
* @method self pay(bool $pay = true)
16
17
*/
17
- class InlineKeyboardButton extends FluentEntity
18
+ class InlineKeyboardButton extends Button
18
19
{
19
20
20
21
protected $ defaults = [
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function __construct(array $data = [])
25
25
/**
26
26
* Adds a new row to the keyboard.
27
27
*
28
- * @param array $buttons
28
+ * @param Button[] $buttons
29
29
* @return $this
30
30
*/
31
31
public function row (array $ buttons = [])
@@ -50,7 +50,7 @@ public function row(array $buttons = [])
50
50
/**
51
51
* Adds buttons one per row to the keyboard.
52
52
*
53
- * @param array $buttons
53
+ * @param Button[] $buttons
54
54
* @return $this
55
55
*/
56
56
public function stack (array $ buttons )
@@ -66,10 +66,10 @@ public function stack(array $buttons)
66
66
/**
67
67
* Adds a button to the last row.
68
68
*
69
- * @param \JsonSerializable $button
69
+ * @param Button $button
70
70
* @return $this
71
71
*/
72
- public function button (\ JsonSerializable $ button )
72
+ public function button (Button $ button )
73
73
{
74
74
$ keyboard = &$ this ->data [static ::$ keyboardFieldName ];
75
75
Original file line number Diff line number Diff line change 2
2
3
3
namespace PhpTelegramBot \FluentKeyboard \ReplyKeyboard ;
4
4
5
- use PhpTelegramBot \FluentKeyboard \FluentEntity ;
5
+ use PhpTelegramBot \FluentKeyboard \Button ;
6
6
7
7
/**
8
8
* @method self text(string $text)
9
9
* @method self requestContact(bool $request_contact = true)
10
10
* @method self requestLocation(bool $request_location = true)
11
11
* @method self requestPoll(KeyboardButtonPollType|array $request_poll = [])
12
12
*/
13
- class KeyboardButton extends FluentEntity
13
+ class KeyboardButton extends Button
14
14
{
15
15
protected $ defaults = [
16
16
'request_contact ' => true ,
Original file line number Diff line number Diff line change 2
2
3
3
namespace PhpTelegramBot \FluentKeyboard \ReplyKeyboard ;
4
4
5
- class KeyboardButtonPollType implements \JsonSerializable
5
+ use PhpTelegramBot \FluentKeyboard \Button ;
6
+
7
+ class KeyboardButtonPollType extends Button
6
8
{
7
9
8
10
protected $ data = [];
You can’t perform that action at this time.
0 commit comments