Skip to content

Commit 35394a6

Browse files
committed
Moving examples to CommandsExamples
1 parent ac2bbc9 commit 35394a6

File tree

4 files changed

+15
-29
lines changed

4 files changed

+15
-29
lines changed

src/Commands/ForcereplyCommand.php renamed to src/CommandsExamples/ForcereplyCommand.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,10 @@ public function execute()
4141
$data['text'] = 'Write something:';
4242
#$data['reply_to_message_id'] = $message_id;
4343

44-
$json = (
45-
new ForceReply(
46-
array(
47-
'selective' => false
48-
)
49-
)
50-
)->toJSON();
44+
$force_reply = new ForceReply(['selective' => false]);
5145

5246
#echo $json;
53-
$data['reply_markup'] = $json;
47+
$data['reply_markup'] = $force_reply;
5448

5549

5650
$result = Request::sendMessage($data);

src/Commands/HidekeyboardCommand.php renamed to src/CommandsExamples/HidekeyboardCommand.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,9 @@ public function execute()
4141
$data['text'] = 'Keyboard Hided';
4242
#$data['reply_to_message_id'] = $message_id;
4343

44-
$json = (
45-
new ReplyKeyBoardHide(
46-
array(
47-
'selective' => false
48-
)
49-
)
50-
)->toJSON();
51-
52-
$data['reply_markup'] = $json;
44+
$reply_keyboard_hide = new ReplyKeyboardHide([ 'selective' => false]);
45+
46+
$data['reply_markup'] = $reply_keyboard_hide;
5347

5448
$result = Request::sendMessage($data);
5549
return $result;

src/Commands/KeyboardCommand.php renamed to src/CommandsExamples/KeyboardCommand.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,16 @@ public function execute()
8484
unset($keyboard);
8585

8686

87-
$json = (
88-
new ReplyKeyboardMarkup(
89-
array(
90-
'keyboard' => $keyboards[1] ,
91-
'resize_keyboard' => true,
92-
'one_time_keyboard' => false,
93-
'selective' => false
94-
)
95-
)
96-
)->toJSON();
87+
$reply_keyboard_markup = new ReplyKeyboardMarkup(
88+
[
89+
'keyboard' => $keyboards[1] ,
90+
'resize_keyboard' => true,
91+
'one_time_keyboard' => false,
92+
'selective' => false
93+
]
94+
);
9795
#echo $json;
98-
$data['reply_markup'] = $json;
96+
$data['reply_markup'] = $reply_keyboard_markup;
9997

10098
$result = Request::sendMessage($data);
10199
return $result;

src/DB.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public static function insertRequest(Update $update)
279279

280280

281281
$sth2->bindParam(':id', $chat_id, \PDO::PARAM_INT);
282-
$sth2->bindParam(':title',$chat->getTitle() , \PDO::PARAM_STR, 255);
282+
$sth2->bindParam(':title', $chat->getTitle(), \PDO::PARAM_STR, 255);
283283
$sth2->bindParam(':date', $date, \PDO::PARAM_STR);
284284

285285
$status = $sth2->execute();

0 commit comments

Comments
 (0)