@@ -78,7 +78,7 @@ public static function initialize(
78
78
array $ credentials ,
79
79
Telegram $ telegram ,
80
80
$ table_prefix = '' ,
81
- $ encoding = 'utf8mb4 '
81
+ $ encoding = 'utf8mb4 ' ,
82
82
): PDO {
83
83
if (empty ($ credentials )) {
84
84
throw new TelegramException ('MySQL credentials not provided! ' );
@@ -127,7 +127,7 @@ public static function initialize(
127
127
public static function externalInitialize (
128
128
PDO $ external_pdo_connection ,
129
129
Telegram $ telegram ,
130
- string $ table_prefix = ''
130
+ string $ table_prefix = '' ,
131
131
): PDO {
132
132
if ($ external_pdo_connection === null ) {
133
133
throw new TelegramException ('MySQL external connection not provided! ' );
@@ -300,12 +300,12 @@ protected static function getTimestamp(?int $unixtime = null): string
300
300
/**
301
301
* Convert array of Entity items to a JSON array
302
302
*
303
- * @todo Find a better way, as json_* functions are very heavy
304
- *
305
303
* @param array $entities
306
304
* @param mixed $default
307
305
*
308
306
* @return mixed
307
+ * @todo Find a better way, as json_* functions are very heavy
308
+ *
309
309
*/
310
310
public static function entitiesArrayToJson (array $ entities , $ default = null )
311
311
{
@@ -346,7 +346,7 @@ protected static function insertTelegramUpdate(
346
346
?string $ chat_member_updated_id = null ,
347
347
?string $ chat_join_request_id = null ,
348
348
?string $ chat_boost_updated_id = null ,
349
- ?string $ chat_boost_removed_id = null
349
+ ?string $ chat_boost_removed_id = null ,
350
350
): ?bool {
351
351
if ($ message_id === null && $ edited_message_id === null && $ channel_post_id === null && $ edited_channel_post_id === null && $ message_reaction_id === null && $ message_reaction_count_id === null && $ inline_query_id === null && $ chosen_inline_result_id === null && $ callback_query_id === null && $ shipping_query_id === null && $ pre_checkout_query_id === null && $ poll_id === null && $ poll_answer_poll_id === null && $ my_chat_member_updated_id === null && $ chat_member_updated_id === null && $ chat_join_request_id === null && $ chat_boost_updated_id === null && $ chat_boost_removed_id === null ) {
352
352
throw new TelegramException ('message_id, edited_message_id, channel_post_id, edited_channel_post_id, message_reaction_id, message_reaction_count_id, inline_query_id, chosen_inline_result_id, callback_query_id, shipping_query_id, pre_checkout_query_id, poll_id, poll_answer_poll_id, my_chat_member_updated_id, chat_member_updated_id, chat_join_request_id, chat_boost_updated_id, chat_boost_removed_id are all null ' );
@@ -539,12 +539,12 @@ public static function insertChat(Chat $chat, ?string $date = null, ?int $migrat
539
539
/**
540
540
* Insert request into database
541
541
*
542
- * @todo self::$pdo->lastInsertId() - unsafe usage if expected previous insert fails?
543
- *
544
542
* @param Update $update
545
543
*
546
544
* @return bool
547
545
* @throws TelegramException
546
+ * @todo self::$pdo->lastInsertId() - unsafe usage if expected previous insert fails?
547
+ *
548
548
*/
549
549
public static function insertRequest (Update $ update ): bool
550
550
{
@@ -640,7 +640,7 @@ public static function insertRequest(Update $update): bool
640
640
$ chat_member_updated_id ,
641
641
$ chat_join_request_id ,
642
642
$ chat_boost_updated_id ,
643
- $ chat_boost_removed_id
643
+ $ chat_boost_removed_id,
644
644
);
645
645
}
646
646
@@ -1322,7 +1322,7 @@ public static function insertMessageRequest(Message $message): bool
1322
1322
`location`, `venue`, `poll`, `dice`, `new_chat_members`, `left_chat_member`,
1323
1323
`new_chat_title`, `new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
1324
1324
`supergroup_chat_created`, `channel_chat_created`, `message_auto_delete_timer_changed`, `migrate_to_chat_id`, `migrate_from_chat_id`,
1325
- `pinned_message`, `invoice`, `successful_payment`, `user_shared `, `chat_shared`, `connected_website`, `write_access_allowed`, `passport_data`, `proximity_alert_triggered`,
1325
+ `pinned_message`, `invoice`, `successful_payment`, `users_shared `, `chat_shared`, `connected_website`, `write_access_allowed`, `passport_data`, `proximity_alert_triggered`,
1326
1326
`forum_topic_created`, `forum_topic_edited`, `forum_topic_closed`, `forum_topic_reopened`, `general_forum_topic_hidden`, `general_forum_topic_unhidden`,
1327
1327
`video_chat_scheduled`, `video_chat_started`, `video_chat_ended`, `video_chat_participants_invited`, `web_app_data`, `reply_markup`
1328
1328
) VALUES (
@@ -1333,7 +1333,7 @@ public static function insertMessageRequest(Message $message): bool
1333
1333
:location, :venue, :poll, :dice, :new_chat_members, :left_chat_member,
1334
1334
:new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created,
1335
1335
:supergroup_chat_created, :channel_chat_created, :message_auto_delete_timer_changed, :migrate_to_chat_id, :migrate_from_chat_id,
1336
- :pinned_message, :invoice, :successful_payment, :user_shared , :chat_shared, :connected_website, :write_access_allowed, :passport_data, :proximity_alert_triggered,
1336
+ :pinned_message, :invoice, :successful_payment, :users_shared , :chat_shared, :connected_website, :write_access_allowed, :passport_data, :proximity_alert_triggered,
1337
1337
:forum_topic_created, :forum_topic_edited, :forum_topic_closed, :forum_topic_reopened, :general_forum_topic_hidden, :general_forum_topic_unhidden,
1338
1338
:video_chat_scheduled, :video_chat_started, :video_chat_ended, :video_chat_participants_invited, :web_app_data, :reply_markup
1339
1339
)
@@ -1411,7 +1411,7 @@ public static function insertMessageRequest(Message $message): bool
1411
1411
$ sth ->bindValue (':pinned_message ' , $ message ->getPinnedMessage ());
1412
1412
$ sth ->bindValue (':invoice ' , $ message ->getInvoice ());
1413
1413
$ sth ->bindValue (':successful_payment ' , $ message ->getSuccessfulPayment ());
1414
- $ sth ->bindValue (':user_shared ' , $ message ->getUserShared ());
1414
+ $ sth ->bindValue (':users_shared ' , $ message ->getUsersShared ());
1415
1415
$ sth ->bindValue (':chat_shared ' , $ message ->getChatShared ());
1416
1416
$ sth ->bindValue (':connected_website ' , $ message ->getConnectedWebsite ());
1417
1417
$ sth ->bindValue (':write_access_allowed ' , $ message ->getWriteAccessAllowed ());
0 commit comments