Passed
Push — main ( 104144...d23e8a )
by Miaad
10:23
created
src/telegram/request.php 1 patch
Spacing   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -503,95 +503,95 @@  discard block
 block discarded – undo
503 503
     ];
504 504
 
505 505
     private const METHODS_KEYS = [
506
-        'getUpdates'                      => ['offset','limit','timeout','allowed_updates','token','forgot','answer'],
507
-        'setWebhook'                      => ['url','certificate','ip_address','max_connections','allowed_updates','drop_pending_updates','secret_token','token','forgot','answer'],
508
-        'deleteWebhook'                   => ['drop_pending_updates','token','forgot','answer'],
509
-        'getWebhookInfo'                  => ['token','forgot','answer'],
510
-        'getMe'                           => ['token','forgot','answer'],
511
-        'logOut'                          => ['token','forgot','answer'],
512
-        'close'                           => ['token','forgot','answer'],
513
-        'sendMessage'                     => ['text','chat_id','parse_mode','entities','disable_web_page_preview','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
514
-        'forwardMessage'                  => ['chat_id','from_chat_id','disable_notification','protect_content','message_id','token','forgot','answer','message_thread_id'],
515
-        'copyMessage'                     => ['chat_id','from_chat_id','message_id','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
516
-        'sendPhoto'                       => ['photo','chat_id','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','has_spoiler','message_thread_id'],
517
-        'sendAudio'                       => ['audio','chat_id','caption','parse_mode','caption_entities','duration','performer','title','thumb','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
518
-        'sendDocument'                    => ['document','chat_id','thumb','caption','parse_mode','caption_entities','disable_content_type_detection','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
519
-        'sendVideo'                       => ['video','chat_id','duration','width','height','thumb','caption','parse_mode','caption_entities','supports_streaming','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','has_spoiler','message_thread_id'],
520
-        'sendAnimation'                   => ['animation','chat_id','duration','width','height','thumb','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','has_spoiler','message_thread_id'],
521
-        'sendVoice'                       => ['voice','chat_id','caption','parse_mode','caption_entities','duration','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
522
-        'sendVideoNote'                   => ['video_note','chat_id','duration','length','thumb','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
523
-        'sendMediaGroup'                  => ['media','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','token','forgot','answer','message_thread_id'],
524
-        'sendLocation'                    => ['latitude','longitude','chat_id','horizontal_accuracy','live_period','heading','proximity_alert_radius','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
525
-        'editMessageLiveLocation'         => ['latitude','longitude','chat_id','message_id','inline_message_id','horizontal_accuracy','heading','proximity_alert_radius','reply_markup','token','forgot','answer'],
526
-        'stopMessageLiveLocation'         => ['chat_id','message_id','inline_message_id','reply_markup','token','forgot','answer'],
527
-        'sendVenue'                       => ['chat_id','latitude','longitude','title','address','foursquare_id','foursquare_type','google_place_id','google_place_type','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
528
-        'sendContact'                     => ['phone_number','first_name','chat_id','last_name','vcard','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
529
-        'sendPoll'                        => ['question','options','chat_id','is_anonymous','type','allows_multiple_answers','correct_option_id','explanation','explanation_parse_mode','explanation_entities','open_period','close_date','is_closed','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
530
-        'sendDice'                        => ['chat_id','emoji','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
531
-        'sendChatAction'                  => ['chat_id','action','token','forgot','answer','message_thread_id'],
532
-        'getUserProfilePhotos'            => ['user_id','offset','limit','token','forgot','answer'],
533
-        'getFile'                         => ['file_id','token','forgot','answer'],
534
-        'banChatMember'                   => ['chat_id','user_id','until_date','revoke_messages','token','forgot','answer'],
535
-        'unbanChatMember'                 => ['chat_id','user_id','only_if_banned','token','forgot','answer'],
536
-        'restrictChatMember'              => ['permissions','chat_id','user_id','until_date','token','forgot','answer','use_independent_chat_permissions'],
537
-        'promoteChatMember'               => ['chat_id','user_id','is_anonymous','can_manage_chat','can_post_messages','can_edit_messages','can_delete_messages','can_manage_video_chats','can_restrict_members','can_promote_members','can_change_info','can_invite_users','can_pin_messages','can_manage_topics','token','forgot','answer'],
538
-        'setChatAdministratorCustomTitle' => ['custom_title','chat_id','user_id','token','forgot','answer'],
539
-        'banChatSenderChat'               => ['sender_chat_id','chat_id','token','forgot','answer'],
540
-        'unbanChatSenderChat'             => ['sender_chat_id','chat_id','token','forgot','answer'],
541
-        'setChatPermissions'              => ['permissions','chat_id','token','forgot','answer','use_independent_chat_permissions'],
542
-        'exportChatInviteLink'            => ['chat_id','token','forgot','answer'],
543
-        'createChatInviteLink'            => ['chat_id','name','expire_date','member_limit','creates_join_request','token','forgot','answer'],
544
-        'editChatInviteLink'              => ['invite_link','chat_id','name','expire_date','member_limit','creates_join_request','token','forgot','answer'],
545
-        'revokeChatInviteLink'            => ['invite_link','chat_id','token','forgot','answer'],
546
-        'approveChatJoinRequest'          => ['chat_id','user_id','token','forgot','answer'],
547
-        'declineChatJoinRequest'          => ['chat_id','user_id','token','forgot','answer'],
548
-        'setChatPhoto'                    => ['photo','chat_id','token','forgot','answer'],
549
-        'deleteChatPhoto'                 => ['chat_id','token','forgot','answer'],
550
-        'setChatTitle'                    => ['title','chat_id','token','forgot','answer'],
551
-        'setChatDescription'              => ['chat_id','description','token','forgot','answer'],
552
-        'pinChatMessage'                  => ['message_id','chat_id','disable_notification','token','forgot','answer'],
553
-        'unpinChatMessage'                => ['chat_id','message_id','token','forgot','answer'],
554
-        'unpinAllChatMessages'            => ['chat_id','token','forgot','answer'],
555
-        'leaveChat'                       => ['chat_id','token','forgot','answer'],
556
-        'getChat'                         => ['chat_id','token','forgot','answer'],
557
-        'getChatAdministrators'           => ['chat_id','token','forgot','answer'],
558
-        'getChatMemberCount'              => ['chat_id','token','forgot','answer'],
559
-        'getChatMember'                   => ['chat_id','user_id','token','forgot','answer'],
560
-        'setChatStickerSet'               => ['sticker_set_name','chat_id','token','forgot','answer'],
561
-        'deleteChatStickerSet'            => ['chat_id','token','forgot','answer'],
562
-        'answerCallbackQuery'             => ['callback_query_id','text','show_alert','url','cache_time','token','forgot','answer'],
563
-        'setMyCommands'                   => ['commands','scope','language_code','token','forgot','answer'],
564
-        'deleteMyCommands'                => ['scope','language_code','token','forgot','answer'],
565
-        'getMyCommands'                   => ['scope','language_code','token','forgot','answer'],
566
-        'setChatMenuButton'               => ['chat_id','menu_button','token','forgot','answer'],
567
-        'getChatMenuButton'               => ['chat_id','token','forgot','answer'],
568
-        'setMyDefaultAdministratorRights' => ['rights','for_channels','token','forgot','answer'],
569
-        'getMyDefaultAdministratorRights' => ['for_channels','token','forgot','answer'],
570
-        'editMessageText'                 => ['text','chat_id','message_id','inline_message_id','parse_mode','entities','disable_web_page_preview','reply_markup','token','forgot','answer'],
571
-        'editMessageCaption'              => ['chat_id','message_id','inline_message_id','caption','parse_mode','caption_entities','reply_markup','token','forgot','answer'],
572
-        'editMessageMedia'                => ['media','chat_id','message_id','inline_message_id','reply_markup','token','forgot','answer'],
573
-        'editMessageReplyMarkup'          => ['chat_id','message_id','inline_message_id','reply_markup','token','forgot','answer'],
574
-        'stopPoll'                        => ['chat_id','message_id','reply_markup','token','forgot','answer'],
575
-        'deleteMessage'                   => ['chat_id','message_id','token','forgot','answer'],
576
-        'sendSticker'                     => ['sticker','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
577
-        'getStickerSet'                   => ['name','token','forgot','answer'],
506
+        'getUpdates'                      => ['offset', 'limit', 'timeout', 'allowed_updates', 'token', 'forgot', 'answer'],
507
+        'setWebhook'                      => ['url', 'certificate', 'ip_address', 'max_connections', 'allowed_updates', 'drop_pending_updates', 'secret_token', 'token', 'forgot', 'answer'],
508
+        'deleteWebhook'                   => ['drop_pending_updates', 'token', 'forgot', 'answer'],
509
+        'getWebhookInfo'                  => ['token', 'forgot', 'answer'],
510
+        'getMe'                           => ['token', 'forgot', 'answer'],
511
+        'logOut'                          => ['token', 'forgot', 'answer'],
512
+        'close'                           => ['token', 'forgot', 'answer'],
513
+        'sendMessage'                     => ['text', 'chat_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
514
+        'forwardMessage'                  => ['chat_id', 'from_chat_id', 'disable_notification', 'protect_content', 'message_id', 'token', 'forgot', 'answer', 'message_thread_id'],
515
+        'copyMessage'                     => ['chat_id', 'from_chat_id', 'message_id', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
516
+        'sendPhoto'                       => ['photo', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'has_spoiler', 'message_thread_id'],
517
+        'sendAudio'                       => ['audio', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'duration', 'performer', 'title', 'thumb', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
518
+        'sendDocument'                    => ['document', 'chat_id', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'disable_content_type_detection', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
519
+        'sendVideo'                       => ['video', 'chat_id', 'duration', 'width', 'height', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'supports_streaming', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'has_spoiler', 'message_thread_id'],
520
+        'sendAnimation'                   => ['animation', 'chat_id', 'duration', 'width', 'height', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'has_spoiler', 'message_thread_id'],
521
+        'sendVoice'                       => ['voice', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'duration', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
522
+        'sendVideoNote'                   => ['video_note', 'chat_id', 'duration', 'length', 'thumb', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
523
+        'sendMediaGroup'                  => ['media', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'token', 'forgot', 'answer', 'message_thread_id'],
524
+        'sendLocation'                    => ['latitude', 'longitude', 'chat_id', 'horizontal_accuracy', 'live_period', 'heading', 'proximity_alert_radius', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
525
+        'editMessageLiveLocation'         => ['latitude', 'longitude', 'chat_id', 'message_id', 'inline_message_id', 'horizontal_accuracy', 'heading', 'proximity_alert_radius', 'reply_markup', 'token', 'forgot', 'answer'],
526
+        'stopMessageLiveLocation'         => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'forgot', 'answer'],
527
+        'sendVenue'                       => ['chat_id', 'latitude', 'longitude', 'title', 'address', 'foursquare_id', 'foursquare_type', 'google_place_id', 'google_place_type', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
528
+        'sendContact'                     => ['phone_number', 'first_name', 'chat_id', 'last_name', 'vcard', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
529
+        'sendPoll'                        => ['question', 'options', 'chat_id', 'is_anonymous', 'type', 'allows_multiple_answers', 'correct_option_id', 'explanation', 'explanation_parse_mode', 'explanation_entities', 'open_period', 'close_date', 'is_closed', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
530
+        'sendDice'                        => ['chat_id', 'emoji', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
531
+        'sendChatAction'                  => ['chat_id', 'action', 'token', 'forgot', 'answer', 'message_thread_id'],
532
+        'getUserProfilePhotos'            => ['user_id', 'offset', 'limit', 'token', 'forgot', 'answer'],
533
+        'getFile'                         => ['file_id', 'token', 'forgot', 'answer'],
534
+        'banChatMember'                   => ['chat_id', 'user_id', 'until_date', 'revoke_messages', 'token', 'forgot', 'answer'],
535
+        'unbanChatMember'                 => ['chat_id', 'user_id', 'only_if_banned', 'token', 'forgot', 'answer'],
536
+        'restrictChatMember'              => ['permissions', 'chat_id', 'user_id', 'until_date', 'token', 'forgot', 'answer', 'use_independent_chat_permissions'],
537
+        'promoteChatMember'               => ['chat_id', 'user_id', 'is_anonymous', 'can_manage_chat', 'can_post_messages', 'can_edit_messages', 'can_delete_messages', 'can_manage_video_chats', 'can_restrict_members', 'can_promote_members', 'can_change_info', 'can_invite_users', 'can_pin_messages', 'can_manage_topics', 'token', 'forgot', 'answer'],
538
+        'setChatAdministratorCustomTitle' => ['custom_title', 'chat_id', 'user_id', 'token', 'forgot', 'answer'],
539
+        'banChatSenderChat'               => ['sender_chat_id', 'chat_id', 'token', 'forgot', 'answer'],
540
+        'unbanChatSenderChat'             => ['sender_chat_id', 'chat_id', 'token', 'forgot', 'answer'],
541
+        'setChatPermissions'              => ['permissions', 'chat_id', 'token', 'forgot', 'answer', 'use_independent_chat_permissions'],
542
+        'exportChatInviteLink'            => ['chat_id', 'token', 'forgot', 'answer'],
543
+        'createChatInviteLink'            => ['chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'forgot', 'answer'],
544
+        'editChatInviteLink'              => ['invite_link', 'chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'forgot', 'answer'],
545
+        'revokeChatInviteLink'            => ['invite_link', 'chat_id', 'token', 'forgot', 'answer'],
546
+        'approveChatJoinRequest'          => ['chat_id', 'user_id', 'token', 'forgot', 'answer'],
547
+        'declineChatJoinRequest'          => ['chat_id', 'user_id', 'token', 'forgot', 'answer'],
548
+        'setChatPhoto'                    => ['photo', 'chat_id', 'token', 'forgot', 'answer'],
549
+        'deleteChatPhoto'                 => ['chat_id', 'token', 'forgot', 'answer'],
550
+        'setChatTitle'                    => ['title', 'chat_id', 'token', 'forgot', 'answer'],
551
+        'setChatDescription'              => ['chat_id', 'description', 'token', 'forgot', 'answer'],
552
+        'pinChatMessage'                  => ['message_id', 'chat_id', 'disable_notification', 'token', 'forgot', 'answer'],
553
+        'unpinChatMessage'                => ['chat_id', 'message_id', 'token', 'forgot', 'answer'],
554
+        'unpinAllChatMessages'            => ['chat_id', 'token', 'forgot', 'answer'],
555
+        'leaveChat'                       => ['chat_id', 'token', 'forgot', 'answer'],
556
+        'getChat'                         => ['chat_id', 'token', 'forgot', 'answer'],
557
+        'getChatAdministrators'           => ['chat_id', 'token', 'forgot', 'answer'],
558
+        'getChatMemberCount'              => ['chat_id', 'token', 'forgot', 'answer'],
559
+        'getChatMember'                   => ['chat_id', 'user_id', 'token', 'forgot', 'answer'],
560
+        'setChatStickerSet'               => ['sticker_set_name', 'chat_id', 'token', 'forgot', 'answer'],
561
+        'deleteChatStickerSet'            => ['chat_id', 'token', 'forgot', 'answer'],
562
+        'answerCallbackQuery'             => ['callback_query_id', 'text', 'show_alert', 'url', 'cache_time', 'token', 'forgot', 'answer'],
563
+        'setMyCommands'                   => ['commands', 'scope', 'language_code', 'token', 'forgot', 'answer'],
564
+        'deleteMyCommands'                => ['scope', 'language_code', 'token', 'forgot', 'answer'],
565
+        'getMyCommands'                   => ['scope', 'language_code', 'token', 'forgot', 'answer'],
566
+        'setChatMenuButton'               => ['chat_id', 'menu_button', 'token', 'forgot', 'answer'],
567
+        'getChatMenuButton'               => ['chat_id', 'token', 'forgot', 'answer'],
568
+        'setMyDefaultAdministratorRights' => ['rights', 'for_channels', 'token', 'forgot', 'answer'],
569
+        'getMyDefaultAdministratorRights' => ['for_channels', 'token', 'forgot', 'answer'],
570
+        'editMessageText'                 => ['text', 'chat_id', 'message_id', 'inline_message_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'reply_markup', 'token', 'forgot', 'answer'],
571
+        'editMessageCaption'              => ['chat_id', 'message_id', 'inline_message_id', 'caption', 'parse_mode', 'caption_entities', 'reply_markup', 'token', 'forgot', 'answer'],
572
+        'editMessageMedia'                => ['media', 'chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'forgot', 'answer'],
573
+        'editMessageReplyMarkup'          => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'forgot', 'answer'],
574
+        'stopPoll'                        => ['chat_id', 'message_id', 'reply_markup', 'token', 'forgot', 'answer'],
575
+        'deleteMessage'                   => ['chat_id', 'message_id', 'token', 'forgot', 'answer'],
576
+        'sendSticker'                     => ['sticker', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
577
+        'getStickerSet'                   => ['name', 'token', 'forgot', 'answer'],
578 578
         'getCustomEmojiStickers'          => ['custom_emoji_ids', 'token', 'return_array', 'forgot', 'answer'],
579
-        'uploadStickerFile'               => ['png_sticker','user_id','token','forgot','answer'],
580
-        'createNewStickerSet'             => ['name','title','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','sticker_type','contains_masks','mask_position','token','forgot','answer'],
581
-        'addStickerToSet'                 => ['name','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','mask_position','token','forgot','answer'],
582
-        'setStickerPositionInSet'         => ['sticker','position','token','forgot','answer'],
583
-        'deleteStickerFromSet'            => ['sticker','token','forgot','answer'],
584
-        'setStickerSetThumb'              => ['name','user_id','thumb','token','forgot','answer'],
585
-        'answerInlineQuery'               => ['results','inline_query_id','cache_time','is_personal','next_offset','switch_pm_text','switch_pm_parameter','token','forgot','answer'],
586
-        'answerWebAppQuery'               => ['web_app_query_id','result','token','forgot','answer'],
587
-        'sendInvoice'                     => ['title','description','payload','provider_token','currency','prices','chat_id','max_tip_amount','suggested_tip_amounts','start_parameter','provider_data','photo_url','photo_size','photo_width','photo_height','need_name','need_phone_number','need_email','need_shipping_address','send_phone_number_to_provider','send_email_to_provider','is_flexible','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer','message_thread_id'],
588
-        'createInvoiceLink'               => ['title','description','payload','provider_token','currency','prices','max_tip_amount','suggested_tip_amounts','provider_data','photo_url','photo_size','photo_width','photo_height','need_name','need_phone_number','need_email','need_shipping_address','send_phone_number_to_provider','send_email_to_provider','is_flexible','token','forgot','answer'],
589
-        'answerShippingQuery'             => ['ok','shipping_query_id','shipping_options','error_message','token','forgot','answer'],
590
-        'answerPreCheckoutQuery'          => ['ok','pre_checkout_query_id','error_message','token','forgot','answer'],
591
-        'setPassportDataErrors'           => ['errors','user_id','token','forgot','answer'],
592
-        'sendGame'                        => ['game_short_name','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','forgot','answer', 'message_thread_id'],
593
-        'setGameScore'                    => ['score','user_id','force','disable_edit_message','chat_id','message_id','inline_message_id','token','forgot','answer'],
594
-        'getGameHighScores'               => ['user_id','chat_id','message_id','inline_message_id','token','forgot','answer'],
579
+        'uploadStickerFile'               => ['png_sticker', 'user_id', 'token', 'forgot', 'answer'],
580
+        'createNewStickerSet'             => ['name', 'title', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'sticker_type', 'contains_masks', 'mask_position', 'token', 'forgot', 'answer'],
581
+        'addStickerToSet'                 => ['name', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'mask_position', 'token', 'forgot', 'answer'],
582
+        'setStickerPositionInSet'         => ['sticker', 'position', 'token', 'forgot', 'answer'],
583
+        'deleteStickerFromSet'            => ['sticker', 'token', 'forgot', 'answer'],
584
+        'setStickerSetThumb'              => ['name', 'user_id', 'thumb', 'token', 'forgot', 'answer'],
585
+        'answerInlineQuery'               => ['results', 'inline_query_id', 'cache_time', 'is_personal', 'next_offset', 'switch_pm_text', 'switch_pm_parameter', 'token', 'forgot', 'answer'],
586
+        'answerWebAppQuery'               => ['web_app_query_id', 'result', 'token', 'forgot', 'answer'],
587
+        'sendInvoice'                     => ['title', 'description', 'payload', 'provider_token', 'currency', 'prices', 'chat_id', 'max_tip_amount', 'suggested_tip_amounts', 'start_parameter', 'provider_data', 'photo_url', 'photo_size', 'photo_width', 'photo_height', 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', 'send_phone_number_to_provider', 'send_email_to_provider', 'is_flexible', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
588
+        'createInvoiceLink'               => ['title', 'description', 'payload', 'provider_token', 'currency', 'prices', 'max_tip_amount', 'suggested_tip_amounts', 'provider_data', 'photo_url', 'photo_size', 'photo_width', 'photo_height', 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', 'send_phone_number_to_provider', 'send_email_to_provider', 'is_flexible', 'token', 'forgot', 'answer'],
589
+        'answerShippingQuery'             => ['ok', 'shipping_query_id', 'shipping_options', 'error_message', 'token', 'forgot', 'answer'],
590
+        'answerPreCheckoutQuery'          => ['ok', 'pre_checkout_query_id', 'error_message', 'token', 'forgot', 'answer'],
591
+        'setPassportDataErrors'           => ['errors', 'user_id', 'token', 'forgot', 'answer'],
592
+        'sendGame'                        => ['game_short_name', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'forgot', 'answer', 'message_thread_id'],
593
+        'setGameScore'                    => ['score', 'user_id', 'force', 'disable_edit_message', 'chat_id', 'message_id', 'inline_message_id', 'token', 'forgot', 'answer'],
594
+        'getGameHighScores'               => ['user_id', 'chat_id', 'message_id', 'inline_message_id', 'token', 'forgot', 'answer'],
595 595
         'getForumTopicIconStickers'       => ['token', 'return_array', 'forgot', 'answer'],
596 596
         'createForumTopic'                => ['chat_id', 'name', 'icon_color', 'icon_custom_emoji_id', 'token', 'return_array', 'forgot', 'answer'],
597 597
         'editForumTopic'                  => ['chat_id', 'name', 'icon_custom_emoji_id', 'token', 'return_array', 'forgot', 'answer', 'message_thread_id'],
@@ -632,8 +632,8 @@  discard block
 block discarded – undo
632 632
         'logOut'                          => [],
633 633
         'close'                           => [],
634 634
         'sendMessage'                     => ['chat_id'],
635
-        'forwardMessage'                  => ['from_chat_id','message_id'],
636
-        'copyMessage'                     => ['from_chat_id','message_id'],
635
+        'forwardMessage'                  => ['from_chat_id', 'message_id'],
636
+        'copyMessage'                     => ['from_chat_id', 'message_id'],
637 637
         'sendPhoto'                       => ['chat_id'],
638 638
         'sendAudio'                       => ['chat_id'],
639 639
         'sendDocument'                    => ['chat_id'],
@@ -649,15 +649,15 @@  discard block
 block discarded – undo
649 649
         'sendContact'                     => ['chat_id'],
650 650
         'sendPoll'                        => ['chat_id'],
651 651
         'sendDice'                        => ['chat_id'],
652
-        'sendChatAction'                  => ['chat_id','action'],
652
+        'sendChatAction'                  => ['chat_id', 'action'],
653 653
         'getUserProfilePhotos'            => ['user_id'],
654 654
         'getFile'                         => ['file_id'],
655
-        'banChatMember'                   => ['chat_id','user_id'],
656
-        'kickChatMember'                  => ['chat_id','user_id'],
657
-        'unbanChatMember'                 => ['chat_id','user_id'],
658
-        'restrictChatMember'              => ['chat_id','user_id'],
659
-        'promoteChatMember'               => ['chat_id','user_id'],
660
-        'setChatAdministratorCustomTitle' => ['chat_id','user_id'],
655
+        'banChatMember'                   => ['chat_id', 'user_id'],
656
+        'kickChatMember'                  => ['chat_id', 'user_id'],
657
+        'unbanChatMember'                 => ['chat_id', 'user_id'],
658
+        'restrictChatMember'              => ['chat_id', 'user_id'],
659
+        'promoteChatMember'               => ['chat_id', 'user_id'],
660
+        'setChatAdministratorCustomTitle' => ['chat_id', 'user_id'],
661 661
         'banChatSenderChat'               => ['chat_id'],
662 662
         'unbanChatSenderChat'             => ['chat_id'],
663 663
         'setChatPermissions'              => ['chat_id'],
@@ -665,8 +665,8 @@  discard block
 block discarded – undo
665 665
         'createChatInviteLink'            => ['chat_id'],
666 666
         'editChatInviteLink'              => ['chat_id'],
667 667
         'revokeChatInviteLink'            => ['chat_id'],
668
-        'approveChatJoinRequest'          => ['chat_id','user_id'],
669
-        'declineChatJoinRequest'          => ['chat_id','user_id'],
668
+        'approveChatJoinRequest'          => ['chat_id', 'user_id'],
669
+        'declineChatJoinRequest'          => ['chat_id', 'user_id'],
670 670
         'setChatPhoto'                    => ['chat_id'],
671 671
         'deleteChatPhoto'                 => ['chat_id'],
672 672
         'setChatTitle'                    => ['chat_id'],
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
         'getChat'                         => ['chat_id'],
679 679
         'getChatAdministrators'           => ['chat_id'],
680 680
         'getChatMembersCount'             => ['chat_id'],
681
-        'getChatMember'                   => ['chat_id','user_id'],
681
+        'getChatMember'                   => ['chat_id', 'user_id'],
682 682
         'setChatStickerSet'               => ['chat_id'],
683 683
         'deleteChatStickerSet'            => ['chat_id'],
684 684
         'answerCallbackQuery'             => ['callback_query_id'],
@@ -689,12 +689,12 @@  discard block
 block discarded – undo
689 689
         'getChatMenuButton'               => [],
690 690
         'setMyDefaultAdministratorRights' => [],
691 691
         'getMyDefaultAdministratorRights' => [],
692
-        'editMessageText'                 => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
693
-        'editMessageCaption'              => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
694
-        'editMessageMedia'                => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
695
-        'editMessageReplyMarkup'          => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
696
-        'stopPoll'                        => ['chat_id','message_id'],
697
-        'deleteMessage'                   => ['chat_id','message_id'],
692
+        'editMessageText'                 => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
693
+        'editMessageCaption'              => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
694
+        'editMessageMedia'                => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
695
+        'editMessageReplyMarkup'          => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
696
+        'stopPoll'                        => ['chat_id', 'message_id'],
697
+        'deleteMessage'                   => ['chat_id', 'message_id'],
698 698
         'sendSticker'                     => ['chat_id'],
699 699
         'getStickerSet'                   => [],
700 700
         'uploadStickerFile'               => ['user_id'],
@@ -710,8 +710,8 @@  discard block
 block discarded – undo
710 710
         'answerPreCheckoutQuery'          => ['pre_checkout_query_id'],
711 711
         'setPassportDataErrors'           => ['user_id'],
712 712
         'sendGame'                        => ['chat_id'],
713
-        'setGameScore'                    => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
714
-        'getGameHighScores'               => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']]
713
+        'setGameScore'                    => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
714
+        'getGameHighScores'               => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']]
715 715
     ];
716 716
 
717 717
     private const METHODS_RETURN = [
@@ -765,29 +765,29 @@  discard block
 block discarded – undo
765 765
         'getGameHighScores' => ['BPT\types\gameHighScore']
766 766
     ];
767 767
 
768
-    public static function __callStatic (string $name, array $arguments) {
768
+    public static function __callStatic(string $name, array $arguments) {
769 769
         if (!$action = self::methodAction($name)) {
770
-            logger::write("$name method is not supported",loggerTypes::ERROR);
770
+            logger::write("$name method is not supported", loggerTypes::ERROR);
771 771
             throw new bptException('METHOD_NOT_FOUND');
772 772
         }
773 773
         self::checkArguments($arguments);
774
-        self::keysName($action,$arguments);
775
-        self::readyFile($action,$arguments);
776
-        self::setDefaults($action,$arguments);
774
+        self::keysName($action, $arguments);
775
+        self::readyFile($action, $arguments);
776
+        self::setDefaults($action, $arguments);
777 777
         self::cleanArguments($arguments);
778 778
 
779 779
         if (isset($arguments['answer']) && $arguments['answer'] === true) {
780 780
             unset($arguments['answer']);
781 781
             if (!answer::isAnswered()) {
782
-                return answer::init($action,$arguments);
782
+                return answer::init($action, $arguments);
783 783
             }
784
-            logger::write('you can use answer mode only once for each webhook update, Others will be called like normal',loggerTypes::WARNING);
784
+            logger::write('you can use answer mode only once for each webhook update, Others will be called like normal', loggerTypes::WARNING);
785 785
         }
786
-        $result = curl::init($action,$arguments);
786
+        $result = curl::init($action, $arguments);
787 787
         if (!is_object($result)) {
788 788
             return false;
789 789
         }
790
-        return self::processResponse($action,$result);
790
+        return self::processResponse($action, $result);
791 791
     }
792 792
 
793 793
     private static function checkArguments(array &$arguments): void {
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
         }
797 797
     }
798 798
 
799
-    private static function keysName (string $name, array &$arguments): void {
799
+    private static function keysName(string $name, array &$arguments): void {
800 800
         foreach ($arguments as $key => $argument) {
801 801
             if (is_numeric($key) && isset(self::METHODS_KEYS[$name][$key])) {
802 802
                 $arguments[self::METHODS_KEYS[$name][$key]] = $argument;
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
         }
806 806
     }
807 807
 
808
-    private static function methodAction(string $name): string|false {
808
+    private static function methodAction(string $name): string | false {
809 809
         return self::METHODS_ACTION[str_replace('_', '', strtolower($name))] ?? false;
810 810
     }
811 811
 
@@ -838,11 +838,11 @@  discard block
 block discarded – undo
838 838
         }
839 839
     }
840 840
 
841
-    private static function methodFile(string $name): array|false {
841
+    private static function methodFile(string $name): array | false {
842 842
         return self::METHODS_WITH_FILE[$name] ?? false;
843 843
     }
844 844
 
845
-    private static function methodReturn(string $name,stdClass $response) {
845
+    private static function methodReturn(string $name, stdClass $response) {
846 846
         if (!isset(self::METHODS_RETURN[$name])) {
847 847
             return $response->result;
848 848
         }
@@ -861,13 +861,13 @@  discard block
 block discarded – undo
861 861
         $defaults = self::METHODS_EXTRA_DEFAULTS[$name];
862 862
         foreach ($defaults as $key => $default) {
863 863
             if (is_numeric($key)) {
864
-                if (!isset($arguments[$default])){
864
+                if (!isset($arguments[$default])) {
865 865
                     $arguments[$default] = self::catchFields($default);
866 866
                 }
867 867
             }
868 868
             elseif (isset(BPT::$update->$key) || $key === 'other') {
869 869
                 foreach ($default as $def) {
870
-                    if (!isset($arguments[$def])){
870
+                    if (!isset($arguments[$def])) {
871 871
                         $arguments[$def] = self::catchFields($def);
872 872
                     }
873 873
                 }
@@ -880,13 +880,13 @@  discard block
 block discarded – undo
880 880
         self::$status = $response->ok;
881 881
         self::$pure_response = $response;
882 882
         if (!$response->ok) {
883
-            logger::write("Telegram $name method failed : " . json_encode($response), loggerTypes::WARNING);
883
+            logger::write("Telegram $name method failed : ".json_encode($response), loggerTypes::WARNING);
884 884
             return new responseError($response);
885 885
         }
886
-        return self::methodReturn($name,$response);
886
+        return self::methodReturn($name, $response);
887 887
     }
888 888
 
889
-    private static function cleanArguments (array &$arguments): void {
889
+    private static function cleanArguments(array &$arguments): void {
890 890
         foreach ($arguments as $key => $argument) {
891 891
             if ($argument == [] || $argument === null) {
892 892
                 unset($arguments[$key]);
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
      *
901 901
      * @return int|string|bool
902 902
      */
903
-    public static function catchFields (string $field): int|string|bool {
903
+    public static function catchFields(string $field): int | string | bool {
904 904
         switch ($field) {
905 905
             case fields::CHAT_ID :
906 906
             case fields::FROM_CHAT_ID :
@@ -1036,13 +1036,13 @@  discard block
 block discarded – undo
1036 1036
                     default => false
1037 1037
                 };
1038 1038
             case fields::URL :
1039
-                return 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
1039
+                return 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
1040 1040
             default:
1041 1041
                 return false;
1042 1042
         }
1043 1043
     }
1044 1044
 
1045
-    public static function fileLink (string|null $file_id = null): bool|string {
1045
+    public static function fileLink(string | null $file_id = null): bool | string {
1046 1046
         $file = request::getFile($file_id);
1047 1047
         if (!isset($file->file_path)) {
1048 1048
             return false;
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
      *
1065 1065
      * @return bool
1066 1066
      */
1067
-    public static function downloadFile (string|null $destination = null, string|null $file_id = null): bool {
1067
+    public static function downloadFile(string | null $destination = null, string | null $file_id = null): bool {
1068 1068
         return tools::downloadFile(self::fileLink($file_id), $destination);
1069 1069
     }
1070 1070
 
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
      *
1083 1083
      * @return message|bool|responseError
1084 1084
      */
1085
-    public static function sendFile (string $file_id, int|string $chat_id = null, int $message_thread_id = null, string $caption = null, string $parse_mode = null, array $caption_entities = null, bool $disable_notification = null, bool $protect_content = null, int $reply_to_message_id = null, bool $allow_sending_without_reply = null, inlineKeyboardMarkup|replyKeyboardMarkup|replyKeyboardRemove|forceReply|stdClass|array $reply_markup = null, string $token = null, bool $forgot = null, bool $answer = null): message|bool|responseError {
1085
+    public static function sendFile(string $file_id, int | string $chat_id = null, int $message_thread_id = null, string $caption = null, string $parse_mode = null, array $caption_entities = null, bool $disable_notification = null, bool $protect_content = null, int $reply_to_message_id = null, bool $allow_sending_without_reply = null, inlineKeyboardMarkup | replyKeyboardMarkup | replyKeyboardRemove | forceReply | stdClass | array $reply_markup = null, string $token = null, bool $forgot = null, bool $answer = null): message | bool | responseError {
1086 1086
         $type = tools::fileType($file_id);
1087 1087
         return match ($type) {
1088 1088
             fileTypes::VIDEO => request::sendVideo($file_id, $chat_id, null, null, null, null, $caption, $parse_mode, $caption_entities, null, $disable_notification, $protect_content, $reply_to_message_id, $allow_sending_without_reply, $reply_markup, $token, $forgot, $answer, $message_thread_id),
Please login to merge, or discard this patch.
src/telegram/telegram.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * telegram class , Adding normal method call to request class and a simple name for being easy to call
7 7
  */
8 8
 class telegram extends request {
9
-    public function __call (string $name, array $arguments) {
9
+    public function __call(string $name, array $arguments) {
10 10
         return request::$name(...$arguments);
11 11
     }
12 12
 }
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
src/receiver/webhook.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     /**
21 21
      * @internal Only for BPT self usage , Don't use it in your source!
22 22
      */
23
-    public static function init () {
23
+    public static function init() {
24 24
         if (settings::$multi) {
25 25
             multi::init();
26 26
         }
@@ -52,24 +52,24 @@  discard block
 block discarded – undo
52 52
         }
53 53
     }
54 54
 
55
-    protected static function setWebhook(string $url,string $secret = '') {
55
+    protected static function setWebhook(string $url, string $secret = '') {
56 56
         $res = telegram::setWebhook($url, settings::$certificate, max_connections: settings::$max_connection, allowed_updates: settings::$allowed_updates, drop_pending_updates: settings::$skip_old_updates, secret_token: $secret);
57 57
         if (!telegram::$status) {
58
-            logger::write("There is some problem happened , telegram response : \n".json_encode($res),loggerTypes::ERROR);
59
-            BPT::exit(print_r($res,true));
58
+            logger::write("There is some problem happened , telegram response : \n".json_encode($res), loggerTypes::ERROR);
59
+            BPT::exit(print_r($res, true));
60 60
         }
61
-        logger::write('Webhook was set successfully',loggerTypes::INFO);
61
+        logger::write('Webhook was set successfully', loggerTypes::INFO);
62 62
     }
63 63
 
64 64
     protected static function checkURL() {
65 65
         if (!(isset($_SERVER['SERVER_NAME']) && isset($_SERVER['REQUEST_URI']))) {
66
-            logger::write('For using webhook receiver , you should open this file in your webserver(by domain)',loggerTypes::ERROR);
66
+            logger::write('For using webhook receiver , you should open this file in your webserver(by domain)', loggerTypes::ERROR);
67 67
             throw new bptException('WEBHOOK_NEED_URL');
68 68
         }
69 69
     }
70 70
 
71 71
     private static function setURL(): string {
72
-        return (isset(settings::$certificate) ? 'http://' : 'https://') . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
72
+        return (isset(settings::$certificate) ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
73 73
     }
74 74
 
75 75
     protected static function setCertificate() {
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
         self::setCertificate();
93 93
         $url = self::setURL();
94 94
         $secret = !empty(settings::$secret) ? settings::$secret : tools::randomString(64);
95
-        self::setWebhook($url,$secret);
96
-        lock::save('BPT-HOOK',$secret);
95
+        self::setWebhook($url, $secret);
96
+        lock::save('BPT-HOOK', $secret);
97 97
         BPT::exit('Done');
98 98
     }
99 99
 
100 100
     private static function checkSecret() {
101 101
         $secret = lock::read('BPT-HOOK');
102 102
         if ($secret !== self::getSecret()) {
103
-            logger::write('This is not webhook set by BPT, webhook will reset',loggerTypes::WARNING);
103
+            logger::write('This is not webhook set by BPT, webhook will reset', loggerTypes::WARNING);
104 104
             self::processSetWebhook();
105 105
         }
106 106
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      *
119 119
      * @return bool
120 120
      */
121
-    public static function fastClose (int $timeout = 86400): bool {
121
+    public static function fastClose(int $timeout = 86400): bool {
122 122
         if (settings::$multi || !lock::exist('BPT-HOOK') || settings::$receiver !== \BPT\constants\receiver::WEBHOOK) {
123 123
             return false;
124 124
         }
Please login to merge, or discard this patch.
src/database/mysql.php 2 patches
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     /**
28 28
      * If you want to use it in standalone mode , you MUST set `auto_process` to `false`
29 29
      */
30
-    public static function init (string $host = 'localhost', string $username = 'root', string $password = '', string $dbname = '', bool $auto_process = null, int $port = 3306): void {
30
+    public static function init(string $host = 'localhost', string $username = 'root', string $password = '', string $dbname = '', bool $auto_process = null, int $port = 3306): void {
31 31
         $host = settings::$db['host'] ?? $host;
32 32
         $port = settings::$db['port'] ?? $port;
33 33
         $user = settings::$db['user'] ?? settings::$db['username'] ?? $username;
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $dbname = settings::$db['dbname'] ?? $dbname;
37 37
         self::$connection = new mysqli($host, $user, $pass, $dbname, $port);
38 38
         if (self::$connection->connect_errno) {
39
-            logger::write('SQL connection has problem : ' . self::$connection->connect_error, loggerTypes::ERROR);
39
+            logger::write('SQL connection has problem : '.self::$connection->connect_error, loggerTypes::ERROR);
40 40
             throw new bptException('SQL_CONNECTION_PROBLEM');
41 41
         }
42 42
         if (self::$auto_process && !lock::exist('BPT-MYSQL')) {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         }
45 45
     }
46 46
 
47
-    private static function install (): void {
47
+    private static function install(): void {
48 48
         self::pureQuery("
49 49
 CREATE TABLE `users`
50 50
 (
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     /**
66 66
      * @internal Only for BPT self usage , Don't use it in your source!
67 67
      */
68
-    public static function process (): void {
68
+    public static function process(): void {
69 69
         if (self::$auto_process) {
70 70
             if (isset(BPT::$update->message)) {
71 71
                 self::processMessage(BPT::$update->message);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         }
86 86
     }
87 87
 
88
-    private static function processMessage (message $update): void {
88
+    private static function processMessage(message $update): void {
89 89
         $type = $update->chat->type;
90 90
         if ($type === chatType::PRIVATE) {
91 91
             $user_id = $update->from->id;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         }
112 112
     }
113 113
 
114
-    private static function processCallbackQuery (callbackQuery $update): void {
114
+    private static function processCallbackQuery(callbackQuery $update): void {
115 115
         $type = $update->message->chat->type;
116 116
         if ($type === chatType::PRIVATE) {
117 117
             $user_id = $update->from->id;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         }
122 122
     }
123 123
 
124
-    private static function processInlineQuery (inlineQuery $update): void {
124
+    private static function processInlineQuery(inlineQuery $update): void {
125 125
         $type = $update->chat_type;
126 126
         if ($type === chatType::PRIVATE || $type === chatType::SENDER) {
127 127
             $user_id = $update->from->id;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         }
132 132
     }
133 133
 
134
-    private static function processMyChatMember (chatMemberUpdated $update): void {
134
+    private static function processMyChatMember(chatMemberUpdated $update): void {
135 135
         $type = $update->chat->type;
136 136
         if ($type === chatType::PRIVATE) {
137 137
             if ($update->new_chat_member->status === chatMemberStatus::MEMBER) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      *
149 149
      * @return mysqli
150 150
      */
151
-    public static function getMysqli (): mysqli {
151
+    public static function getMysqli(): mysqli {
152 152
         return self::$connection;
153 153
     }
154 154
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      *
158 158
      * @return int|string
159 159
      */
160
-    public static function affected_rows (): int|string {
160
+    public static function affected_rows(): int | string {
161 161
         return self::$connection->affected_rows;
162 162
     }
163 163
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      *
167 167
      * @return int|string
168 168
      */
169
-    public static function insert_id (): int|string {
169
+    public static function insert_id(): int | string {
170 170
         return self::$connection->insert_id;
171 171
     }
172 172
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      *
178 178
      * @return string
179 179
      */
180
-    public static function escapeString (string $text): string {
180
+    public static function escapeString(string $text): string {
181 181
         return self::$connection->real_escape_string($text);
182 182
     }
183 183
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      *
187 187
      * @return string
188 188
      */
189
-    public static function error (): string {
189
+    public static function error(): string {
190 190
         return self::$connection->error;
191 191
     }
192 192
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      *
196 196
      * @return int
197 197
      */
198
-    public static function errno (): int {
198
+    public static function errno(): int {
199 199
         return self::$connection->errno;
200 200
     }
201 201
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      *
207 207
      * @return bool
208 208
      */
209
-    public static function setCharset (string $charset): bool {
209
+    public static function setCharset(string $charset): bool {
210 210
         return self::$connection->set_charset($charset);
211 211
     }
212 212
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
      *
222 222
      * @return mysqli_result|bool
223 223
      */
224
-    public static function pureQuery (string $query): mysqli_result|bool {
224
+    public static function pureQuery(string $query): mysqli_result | bool {
225 225
         return self::$connection->query($query);
226 226
     }
227 227
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
      *
243 243
      * @return mysqli_result|bool
244 244
      */
245
-    public static function query (string $query, array $vars = [], bool $need_result = true): mysqli_result|bool {
245
+    public static function query(string $query, array $vars = [], bool $need_result = true): mysqli_result | bool {
246 246
         if (empty($vars)) {
247 247
             return self::pureQuery($query);
248 248
         }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                 $types .= 's';
260 260
             }
261 261
         }
262
-        $prepare->bind_param($types,...$vars);
262
+        $prepare->bind_param($types, ...$vars);
263 263
         if (!$prepare->execute()) {
264 264
             logger::write(loggerTypes::WARNING, $prepare->error);
265 265
             return false;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         return $need_result ? $prepare->get_result() : true;
268 268
     }
269 269
 
270
-    private static function makeArrayReady (string &$query, array $array, string $operator = ' AND ', bool $is_update = false): array {
270
+    private static function makeArrayReady(string &$query, array $array, string $operator = ' AND ', bool $is_update = false): array {
271 271
         $first = true;
272 272
         $values = [];
273 273
         foreach ($array as $name => $value) {
@@ -277,9 +277,9 @@  discard block
 block discarded – undo
277 277
             else {
278 278
                 $query .= $operator;
279 279
             }
280
-            if ($is_update && str_starts_with($value, '.=') && is_numeric(substr($value,2))) {
280
+            if ($is_update && str_starts_with($value, '.=') && is_numeric(substr($value, 2))) {
281 281
                 $query .= " `$name` = `$name` + ?";
282
-                $values[] = substr($value,2);
282
+                $values[] = substr($value, 2);
283 283
             }
284 284
             else {
285 285
                 $query .= " `$name` = ?";
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         return $values;
291 291
     }
292 292
 
293
-    private static function makeQueryReady (string &$query, array $where = null, int $count = null, int $offset = null): array {
293
+    private static function makeQueryReady(string &$query, array $where = null, int $count = null, int $offset = null): array {
294 294
         $values = [];
295 295
         if (!empty($where)) {
296 296
             $query .= " WHERE";
@@ -322,8 +322,8 @@  discard block
 block discarded – undo
322 322
                 $query .= ' AND';
323 323
             }
324 324
 
325
-            $operator = substr($value,0,2);
326
-            $operator_value = substr($value,2);
325
+            $operator = substr($value, 0, 2);
326
+            $operator_value = substr($value, 2);
327 327
             switch ($operator) {
328 328
                 case '>=':
329 329
                     $query .= " `$name` >= ?";
@@ -360,17 +360,17 @@  discard block
 block discarded – undo
360 360
         return $values;
361 361
     }
362 362
 
363
-    private static function groupByBuilder(string &$query, string|array $group_by = []): void {
363
+    private static function groupByBuilder(string &$query, string | array $group_by = []): void {
364 364
         if (empty($group_by)) {
365 365
             return;
366 366
         }
367 367
         if (is_string($group_by)) {
368 368
             $group_by = [$group_by];
369 369
         }
370
-        $query .= ' GROUP BY `' . implode('`, `',$group_by) . '`';
370
+        $query .= ' GROUP BY `'.implode('`, `', $group_by).'`';
371 371
     }
372 372
 
373
-    private static function orderByBuilder(string &$query, string|array $order_by = []): void {
373
+    private static function orderByBuilder(string &$query, string | array $order_by = []): void {
374 374
         if (empty($order_by)) {
375 375
             return;
376 376
         }
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
                 $query .= ' ,';
418 418
             }
419 419
 
420
-            $operator = substr($value,0,2);
421
-            $operator_value = substr($value,2);
420
+            $operator = substr($value, 0, 2);
421
+            $operator_value = substr($value, 2);
422 422
             switch ($operator) {
423 423
                 case '+=':
424 424
                     $query .= " `$name` = `$name` + ?";
@@ -451,19 +451,19 @@  discard block
 block discarded – undo
451 451
         return $values;
452 452
     }
453 453
 
454
-    private static function insertBuilder(string &$query, string|array $columns, array|string $values): array {
455
-        $query .= '(`' . (is_string($columns) ? $columns : implode('`,`', $columns)) . '`) VALUES (';
454
+    private static function insertBuilder(string &$query, string | array $columns, array | string $values): array {
455
+        $query .= '(`'.(is_string($columns) ? $columns : implode('`,`', $columns)).'`) VALUES (';
456 456
         if (is_string($values)) $values = [$values];
457
-        $query .= '?' . str_repeat(',?', count($values) - 1) . ')';
457
+        $query .= '?'.str_repeat(',?', count($values) - 1).')';
458 458
         return $values;
459 459
     }
460 460
 
461
-    private static function selectBuilder(string &$query, string|array $columns): void {
461
+    private static function selectBuilder(string &$query, string | array $columns): void {
462 462
         if ($columns == '*') {
463 463
             $query .= " * ";
464 464
         }
465 465
         else {
466
-            $query .= ' `' . (is_string($columns) ? $columns : implode('`,`', $columns)) . '` ';
466
+            $query .= ' `'.(is_string($columns) ? $columns : implode('`,`', $columns)).'` ';
467 467
         }
468 468
     }
469 469
 
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
      *
480 480
      * @return mysqli_result|bool
481 481
      */
482
-    public static function delete (string $table, array $where = null, int $count = null, int $offset = null): bool {
482
+    public static function delete(string $table, array $where = null, int $count = null, int $offset = null): bool {
483 483
         $query = "DELETE FROM `$table`";
484 484
         $vars = self::whereBuilder($query, $where);
485 485
         return self::query($query, $vars, false);
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
      *
499 499
      * @return mysqli_result|bool
500 500
      */
501
-    public static function update (string $table, array $modify, array $where = null, int $count = null, int $offset = null): bool {
501
+    public static function update(string $table, array $modify, array $where = null, int $count = null, int $offset = null): bool {
502 502
         $query = "UPDATE `$table` SET";
503 503
         $modify_vars = self::updateBuilder($query, $modify);
504 504
         $where_vars = self::whereBuilder($query, $where);
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
      *
518 518
      * @return mysqli_result|bool
519 519
      */
520
-    public static function insert (string $table, string|array $columns, array|string $values): bool {
520
+    public static function insert(string $table, string | array $columns, array | string $values): bool {
521 521
         $query = "INSERT INTO `$table`";
522 522
         $values = self::insertBuilder($query, $columns, $values);
523 523
         return self::query($query, $values, false);
@@ -540,14 +540,14 @@  discard block
 block discarded – undo
540 540
      *
541 541
      * @return mysqli_result|bool
542 542
      */
543
-    public static function select (string $table, array|string $columns = '*', array $where = null, int $count = null, int $offset = null, array|string $group_by = [], array|string $order_by = []): mysqli_result|bool {
543
+    public static function select(string $table, array | string $columns = '*', array $where = null, int $count = null, int $offset = null, array | string $group_by = [], array | string $order_by = []): mysqli_result | bool {
544 544
         $query = "SELECT";
545 545
         self::selectBuilder($query, $columns);
546 546
         $query .= "FROM `$table`";
547
-        $var = self::whereBuilder($query,$where);
547
+        $var = self::whereBuilder($query, $where);
548 548
         self::groupByBuilder($query, $group_by);
549 549
         self::orderByBuilder($query, $order_by);
550
-        self::countBuilder($query,$count,$offset);
550
+        self::countBuilder($query, $count, $offset);
551 551
         return self::query($query, $var);
552 552
     }
553 553
 
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
      *
563 563
      * @return null|bool|array
564 564
      */
565
-    public static function selectArray (string $table, array|string $columns = '*', array $where = null): bool|array|null {
565
+    public static function selectArray(string $table, array | string $columns = '*', array $where = null): bool | array | null {
566 566
         $res = self::select($table, $columns, $where, 1);
567 567
         if ($res) {
568 568
             return $res->fetch_assoc();
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
      * @param array|string $columns sets column that you want to retrieve , set '*' to retrieve all , default : '*'
580 580
      * @param array|null   $where   Set your ifs default : null
581 581
      */
582
-    public static function selectObject (string $table, array|string $columns = '*', array $where = null) {
582
+    public static function selectObject(string $table, array | string $columns = '*', array $where = null) {
583 583
         $res = self::select($table, $columns, $where, 1);
584 584
         if ($res) {
585 585
             return $res->fetch_object();
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
      *
602 602
      * @return bool|Generator
603 603
      */
604
-    public static function selectEach (string $table, array|string $columns = '*', array $where = null, int $count = null, int $offset = null): bool|Generator {
604
+    public static function selectEach(string $table, array | string $columns = '*', array $where = null, int $count = null, int $offset = null): bool | Generator {
605 605
         $res = self::select($table, $columns, $where, $count, $offset);
606 606
         if ($res) {
607 607
             while ($row = $res->fetch_assoc()) yield $row;
@@ -619,21 +619,21 @@  discard block
 block discarded – undo
619 619
      *
620 620
      * @return string if save is true , return file name otherwise return sql data
621 621
      */
622
-    public static function backup (array $wanted_tables = null, bool $table_data = true, bool $save = true, string $file_name = ''): string {
622
+    public static function backup(array $wanted_tables = null, bool $table_data = true, bool $save = true, string $file_name = ''): string {
623 623
         self::setCharset('utf8mb4');
624
-        $tables = array_column(self::query('SHOW TABLES')->fetch_all(),0);
624
+        $tables = array_column(self::query('SHOW TABLES')->fetch_all(), 0);
625 625
         if (!empty($wanted_tables)) {
626 626
             $tables = array_intersect($tables, $wanted_tables);
627 627
         }
628 628
         $sql = '';
629 629
         foreach ($tables as $table) {
630
-            $sql .= self::query("SHOW CREATE TABLE `$table`")->fetch_row()[1] . ";\n\n";
630
+            $sql .= self::query("SHOW CREATE TABLE `$table`")->fetch_row()[1].";\n\n";
631 631
 
632 632
             if ($table_data) {
633 633
                 $total_rows = self::query("SELECT COUNT(*) as `cnt` FROM `$table`")->fetch_object()->cnt;
634 634
                 for ($i = 0; $i < $total_rows; $i = $i + 1000) {
635
-                    $sql .= "INSERT INTO " . $table . " VALUES";
636
-                    $result = self::select($table, '*' , null, 1000, $i);
635
+                    $sql .= "INSERT INTO ".$table." VALUES";
636
+                    $result = self::select($table, '*', null, 1000, $i);
637 637
                     $field_count = $result->field_count;
638 638
                     $affected_rows = self::affected_rows();
639 639
                     $counter = 1;
@@ -641,12 +641,12 @@  discard block
 block discarded – undo
641 641
                         $sql .= "\n(";
642 642
                         for ($column = 0; $column < $field_count; $column++) {
643 643
                             $row[$column] = str_replace("\n", "\\n", addslashes($row[$column]));
644
-                            $sql .= !empty($row[$column]) ? '"' . $row[$column] . '"' : '""';
644
+                            $sql .= !empty($row[$column]) ? '"'.$row[$column].'"' : '""';
645 645
                             if ($column < $field_count - 1) {
646 646
                                 $sql .= ',';
647 647
                             }
648 648
                         }
649
-                        $sql .= ')' . ($counter == $affected_rows ? ';' : ',');
649
+                        $sql .= ')'.($counter == $affected_rows ? ';' : ',');
650 650
                         $counter++;
651 651
                     }
652 652
                 }
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
             return $sql;
661 661
         }
662 662
         if (empty($file_name)) {
663
-            $file_name = self::query('SELECT database() as `db_name`')->fetch_object()->db_name . time() . '.sql';
663
+            $file_name = self::query('SELECT database() as `db_name`')->fetch_object()->db_name.time().'.sql';
664 664
         }
665 665
         file_put_contents($file_name, $sql);
666 666
         return $file_name;
Please login to merge, or discard this patch.
Braces   +23 added lines, -33 removed lines patch added patch discarded remove patch
@@ -69,17 +69,13 @@  discard block
 block discarded – undo
69 69
         if (self::$auto_process) {
70 70
             if (isset(BPT::$update->message)) {
71 71
                 self::processMessage(BPT::$update->message);
72
-            }
73
-            elseif (isset(BPT::$update->edited_message)) {
72
+            } elseif (isset(BPT::$update->edited_message)) {
74 73
                 self::processMessage(BPT::$update->edited_message);
75
-            }
76
-            elseif (isset(BPT::$update->callback_query)) {
74
+            } elseif (isset(BPT::$update->callback_query)) {
77 75
                 self::processCallbackQuery(BPT::$update->callback_query);
78
-            }
79
-            elseif (isset(BPT::$update->inline_query)) {
76
+            } elseif (isset(BPT::$update->inline_query)) {
80 77
                 self::processInlineQuery(BPT::$update->inline_query);
81
-            }
82
-            elseif (isset(BPT::$update->my_chat_member)) {
78
+            } elseif (isset(BPT::$update->my_chat_member)) {
83 79
                 self::processMyChatMember(BPT::$update->my_chat_member);
84 80
             }
85 81
         }
@@ -136,8 +132,7 @@  discard block
 block discarded – undo
136 132
         if ($type === chatType::PRIVATE) {
137 133
             if ($update->new_chat_member->status === chatMemberStatus::MEMBER) {
138 134
                 self::update('users', ['blocked' => false], ['id' => $update->from->id], 1);
139
-            }
140
-            else {
135
+            } else {
141 136
                 self::update('users', ['blocked' => true], ['id' => $update->from->id], 1);
142 137
             }
143 138
         }
@@ -251,11 +246,9 @@  discard block
 block discarded – undo
251 246
         foreach ($vars as $var) {
252 247
             if (is_int($var)) {
253 248
                 $types .= 'i';
254
-            }
255
-            elseif (is_double($var)) {
249
+            } elseif (is_double($var)) {
256 250
                 $types .= 'd';
257
-            }
258
-            else {
251
+            } else {
259 252
                 $types .= 's';
260 253
             }
261 254
         }
@@ -273,15 +266,13 @@  discard block
 block discarded – undo
273 266
         foreach ($array as $name => $value) {
274 267
             if ($first) {
275 268
                 $first = false;
276
-            }
277
-            else {
269
+            } else {
278 270
                 $query .= $operator;
279 271
             }
280 272
             if ($is_update && str_starts_with($value, '.=') && is_numeric(substr($value,2))) {
281 273
                 $query .= " `$name` = `$name` + ?";
282 274
                 $values[] = substr($value,2);
283
-            }
284
-            else {
275
+            } else {
285 276
                 $query .= " `$name` = ?";
286 277
                 $values[] = $value;
287 278
             }
@@ -298,8 +289,7 @@  discard block
 block discarded – undo
298 289
         }
299 290
         if (!empty($count)) {
300 291
             $query .= !empty($offset) ? " LIMIT $offset,$count" : " LIMIT $count";
301
-        }
302
-        elseif (!empty($offset)) {
292
+        } elseif (!empty($offset)) {
303 293
             $query .= " OFFSET $offset";
304 294
         }
305 295
         return $values;
@@ -317,8 +307,7 @@  discard block
 block discarded – undo
317 307
         foreach ($where as $name => $value) {
318 308
             if ($first) {
319 309
                 $first = false;
320
-            }
321
-            else {
310
+            } else {
322 311
                 $query .= ' AND';
323 312
             }
324 313
 
@@ -384,8 +373,7 @@  discard block
 block discarded – undo
384 373
         foreach ($order_by as $key => $mode) {
385 374
             if ($first) {
386 375
                 $first = false;
387
-            }
388
-            else {
376
+            } else {
389 377
                 $query .= ', ';
390 378
             }
391 379
             if (is_numeric($key)) {
@@ -399,8 +387,7 @@  discard block
 block discarded – undo
399 387
     private static function countBuilder(string &$query, int $count = null, int $offset = null): void {
400 388
         if (!empty($count)) {
401 389
             $query .= !empty($offset) ? " LIMIT $offset,$count" : " LIMIT $count";
402
-        }
403
-        elseif (!empty($offset)) {
390
+        } elseif (!empty($offset)) {
404 391
             $query .= " OFFSET $offset";
405 392
         }
406 393
     }
@@ -412,8 +399,7 @@  discard block
 block discarded – undo
412 399
         foreach ($modify as $name => $value) {
413 400
             if ($first) {
414 401
                 $first = false;
415
-            }
416
-            else {
402
+            } else {
417 403
                 $query .= ' ,';
418 404
             }
419 405
 
@@ -453,7 +439,9 @@  discard block
 block discarded – undo
453 439
 
454 440
     private static function insertBuilder(string &$query, string|array $columns, array|string $values): array {
455 441
         $query .= '(`' . (is_string($columns) ? $columns : implode('`,`', $columns)) . '`) VALUES (';
456
-        if (is_string($values)) $values = [$values];
442
+        if (is_string($values)) {
443
+            $values = [$values];
444
+        }
457 445
         $query .= '?' . str_repeat(',?', count($values) - 1) . ')';
458 446
         return $values;
459 447
     }
@@ -461,8 +449,7 @@  discard block
 block discarded – undo
461 449
     private static function selectBuilder(string &$query, string|array $columns): void {
462 450
         if ($columns == '*') {
463 451
             $query .= " * ";
464
-        }
465
-        else {
452
+        } else {
466 453
             $query .= ' `' . (is_string($columns) ? $columns : implode('`,`', $columns)) . '` ';
467 454
         }
468 455
     }
@@ -604,9 +591,12 @@  discard block
 block discarded – undo
604 591
     public static function selectEach (string $table, array|string $columns = '*', array $where = null, int $count = null, int $offset = null): bool|Generator {
605 592
         $res = self::select($table, $columns, $where, $count, $offset);
606 593
         if ($res) {
607
-            while ($row = $res->fetch_assoc()) yield $row;
594
+            while ($row = $res->fetch_assoc()) {
595
+                yield $row;
596
+            }
597
+        } else {
598
+            return $res;
608 599
         }
609
-        else return $res;
610 600
     }
611 601
 
612 602
     /**
Please login to merge, or discard this patch.
src/BPT.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -271,13 +271,13 @@  discard block
 block discarded – undo
271 271
  * @method bool downloadFile(string|null $destination = null, string|null $file_id = null) download file by file_id and save it to destination
272 272
  * @method message|bool|responseError sendFile(string $file_id, int|string $chat_id = null, int $message_thread_id = null, string $caption = null, string $parse_mode = null, array $caption_entities = null, bool $disable_notification = null, bool $protect_content = null, int $reply_to_message_id = null, bool $allow_sending_without_reply = null, inlineKeyboardMarkup|replyKeyboardMarkup|replyKeyboardRemove|forceReply|stdClass|array $reply_markup = null, string $token = null, bool $forgot = null, bool $answer = null) send file only with file_id
273 273
  */
274
-class BPT extends telegram{
274
+class BPT extends telegram {
275 275
     public static update $update;
276 276
 
277 277
     public static BPT $handler;
278 278
 
279 279
 
280
-    public function __construct (array|stdClass $settings) {
280
+    public function __construct(array | stdClass $settings) {
281 281
         static::$handler = &$this;
282 282
         settings::init($settings);
283 283
     }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     }
288 288
 
289 289
     #[NoReturn]
290
-    public static function exit (string|null $message = null) {
290
+    public static function exit (string | null $message = null) {
291 291
         die($message ?? "<div style='width:98vw;height:98vh;display:flex;justify-content:center;align-items:center;font-size:25vw'>BPT</div>");
292 292
     }
293 293
 }
Please login to merge, or discard this patch.
src/types/message.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
     public int $message_id;
69 69
 
70 70
     /** Optional. Unique identifier of a message thread to which the message belongs; for supergroups only */
71
-    public null|int $message_thread_id = null;
71
+    public null | int $message_thread_id = null;
72 72
 
73 73
     /**
74 74
      * Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field
75 75
      * contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
76 76
      */
77
-    public null|user $from = null;
77
+    public null | user $from = null;
78 78
 
79 79
     /**
80 80
      * Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts,
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake
83 83
      * sender user in non-channel chats, if the message was sent on behalf of a chat.
84 84
      */
85
-    public null|chat $sender_chat = null;
85
+    public null | chat $sender_chat = null;
86 86
 
87 87
     /** Date the message was sent in Unix time */
88 88
     public int $date;
@@ -91,188 +91,188 @@  discard block
 block discarded – undo
91 91
     public chat $chat;
92 92
 
93 93
     /** Optional. For forwarded messages, sender of the original message */
94
-    public null|user $forward_from = null;
94
+    public null | user $forward_from = null;
95 95
 
96 96
     /**
97 97
      * Optional. For messages forwarded from channels or from anonymous administrators, information about the
98 98
      * original sender chat
99 99
      */
100
-    public null|chat $forward_from_chat = null;
100
+    public null | chat $forward_from_chat = null;
101 101
 
102 102
     /** Optional. For messages forwarded from channels, identifier of the original message in the channel */
103
-    public null|int $forward_from_message_id = null;
103
+    public null | int $forward_from_message_id = null;
104 104
 
105 105
     /**
106 106
      * Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator,
107 107
      * signature of the message sender if present
108 108
      */
109
-    public null|string $forward_signature = null;
109
+    public null | string $forward_signature = null;
110 110
 
111 111
     /**
112 112
      * Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in
113 113
      * forwarded messages
114 114
      */
115
-    public null|string $forward_sender_name = null;
115
+    public null | string $forward_sender_name = null;
116 116
 
117 117
     /** Optional. For forwarded messages, date the original message was sent in Unix time */
118
-    public null|int $forward_date = null;
118
+    public null | int $forward_date = null;
119 119
 
120 120
     /** Optional. True, if the message is sent to a forum topic */
121
-    public null|bool $is_topic_message = null;
121
+    public null | bool $is_topic_message = null;
122 122
 
123 123
     /**
124 124
      * Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion
125 125
      * group
126 126
      */
127
-    public null|bool $is_automatic_forward = null;
127
+    public null | bool $is_automatic_forward = null;
128 128
 
129 129
     /**
130 130
      * Optional. For replies, the original message. Note that the Message object in this field will not contain
131 131
      * further reply_to_message fields even if it itself is a reply.
132 132
      */
133
-    public null|message $reply_to_message = null;
133
+    public null | message $reply_to_message = null;
134 134
 
135 135
     /** Optional. Bot through which the message was sent */
136
-    public null|user $via_bot = null;
136
+    public null | user $via_bot = null;
137 137
 
138 138
     /** Optional. Date the message was last edited in Unix time */
139
-    public null|int $edit_date = null;
139
+    public null | int $edit_date = null;
140 140
 
141 141
     /** Optional. True, if the message can't be forwarded */
142
-    public null|bool $has_protected_content = null;
142
+    public null | bool $has_protected_content = null;
143 143
 
144 144
     /** Optional. The unique identifier of a media message group this message belongs to */
145
-    public null|string $media_group_id = null;
145
+    public null | string $media_group_id = null;
146 146
 
147 147
     /**
148 148
      * Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group
149 149
      * administrator
150 150
      */
151
-    public null|string $author_signature = null;
151
+    public null | string $author_signature = null;
152 152
 
153 153
     /** Optional. For text messages, the actual UTF-8 text of the message */
154
-    public null|string $text = null;
154
+    public null | string $text = null;
155 155
 
156 156
     /** Optional. If user message was a command , this parameter will be the command */
157
-    public string|null $command = null;
157
+    public string | null $command = null;
158 158
 
159 159
     /** Optional. If user message was a command , this parameter will be the command username(if exist) */
160
-    public string|null $command_username = null;
160
+    public string | null $command_username = null;
161 161
 
162 162
     /** Optional. If user message was a command , this parameter will be the command payload(if exist) */
163
-    public string|null $command_payload = null;
163
+    public string | null $command_payload = null;
164 164
 
165 165
     /**
166 166
      * Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
167 167
      * @var messageEntity[]
168 168
      */
169
-    public null|array $entities = null;
169
+    public null | array $entities = null;
170 170
 
171 171
     /**
172 172
      * Optional. Message is an animation, information about the animation. For backward compatibility, when this
173 173
      * field is set, the document field will also be set
174 174
      */
175
-    public null|animation $animation = null;
175
+    public null | animation $animation = null;
176 176
 
177 177
     /** Optional. Message is an audio file, information about the file */
178
-    public null|audio $audio = null;
178
+    public null | audio $audio = null;
179 179
 
180 180
     /** Optional. Message is a general file, information about the file */
181
-    public null|document $document = null;
181
+    public null | document $document = null;
182 182
 
183 183
     /**
184 184
      * Optional. Message is a photo, available sizes of the photo
185 185
      * @var photoSize[]
186 186
      */
187
-    public null|array $photo = null;
187
+    public null | array $photo = null;
188 188
 
189 189
     /** Optional. Message is a sticker, information about the sticker */
190
-    public null|sticker $sticker = null;
190
+    public null | sticker $sticker = null;
191 191
 
192 192
     /** Optional. Message is a video, information about the video */
193
-    public null|video $video = null;
193
+    public null | video $video = null;
194 194
 
195 195
     /** Optional. Message is a video note, information about the video message */
196
-    public null|videoNote $video_note = null;
196
+    public null | videoNote $video_note = null;
197 197
 
198 198
     /** Optional. Message is a voice message, information about the file */
199
-    public null|voice $voice = null;
199
+    public null | voice $voice = null;
200 200
 
201 201
     /** Optional. Caption for the animation, audio, document, photo, video or voice */
202
-    public null|string $caption = null;
202
+    public null | string $caption = null;
203 203
 
204 204
     /**
205 205
      * Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear
206 206
      * in the caption
207 207
      * @var messageEntity[]
208 208
      */
209
-    public null|array $caption_entities = null;
209
+    public null | array $caption_entities = null;
210 210
 
211 211
     /** Optional. True, if the message media is covered by a spoiler animation */
212
-    public null|bool $has_media_spoiler = null;
212
+    public null | bool $has_media_spoiler = null;
213 213
 
214 214
     /** Optional. Message is a shared contact, information about the contact */
215
-    public null|contact $contact = null;
215
+    public null | contact $contact = null;
216 216
 
217 217
     /** Optional. Message is a dice with random value */
218
-    public null|dice $dice = null;
218
+    public null | dice $dice = null;
219 219
 
220 220
     /** Optional. Message is a game, information about the game. More about games » */
221
-    public null|game $game = null;
221
+    public null | game $game = null;
222 222
 
223 223
     /** Optional. Message is a native poll, information about the poll */
224
-    public null|poll $poll = null;
224
+    public null | poll $poll = null;
225 225
 
226 226
     /**
227 227
      * Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set,
228 228
      * the location field will also be set
229 229
      */
230
-    public null|venue $venue = null;
230
+    public null | venue $venue = null;
231 231
 
232 232
     /** Optional. Message is a shared location, information about the location */
233
-    public null|location $location = null;
233
+    public null | location $location = null;
234 234
 
235 235
     /**
236 236
      * Optional. New members that were added to the group or supergroup and information about them (the bot itself
237 237
      * may be one of these members)
238 238
      * @var user[]
239 239
      */
240
-    public null|array $new_chat_members = null;
240
+    public null | array $new_chat_members = null;
241 241
 
242 242
     /** Optional. A member was removed from the group, information about them (this member may be the bot itself) */
243
-    public null|user $left_chat_member = null;
243
+    public null | user $left_chat_member = null;
244 244
 
245 245
     /** Optional. A chat title was changed to this value */
246
-    public null|string $new_chat_title = null;
246
+    public null | string $new_chat_title = null;
247 247
 
248 248
     /**
249 249
      * Optional. A chat photo was change to this value
250 250
      * @var photoSize[]
251 251
      */
252
-    public null|array $new_chat_photo = null;
252
+    public null | array $new_chat_photo = null;
253 253
 
254 254
     /** Optional. Service message: the chat photo was deleted */
255
-    public null|bool $delete_chat_photo = null;
255
+    public null | bool $delete_chat_photo = null;
256 256
 
257 257
     /** Optional. Service message: the group has been created */
258
-    public null|bool $group_chat_created = null;
258
+    public null | bool $group_chat_created = null;
259 259
 
260 260
     /**
261 261
      * Optional. Service message: the supergroup has been created. This field can't be received in a message coming
262 262
      * through updates, because bot can't be a member of a supergroup when it is created. It can only be found in
263 263
      * reply_to_message if someone replies to a very first message in a directly created supergroup.
264 264
      */
265
-    public null|bool $supergroup_chat_created = null;
265
+    public null | bool $supergroup_chat_created = null;
266 266
 
267 267
     /**
268 268
      * Optional. Service message: the channel has been created. This field can't be received in a message coming
269 269
      * through updates, because bot can't be a member of a channel when it is created. It can only be found in
270 270
      * reply_to_message if someone replies to a very first message in a channel.
271 271
      */
272
-    public null|bool $channel_chat_created = null;
272
+    public null | bool $channel_chat_created = null;
273 273
 
274 274
     /** Optional. Service message: auto-delete timer settings changed in the chat */
275
-    public null|messageAutoDeleteTimerChanged $message_auto_delete_timer_changed = null;
275
+    public null | messageAutoDeleteTimerChanged $message_auto_delete_timer_changed = null;
276 276
 
277 277
     /**
278 278
      * Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for
281 281
      * storing this identifier.
282 282
      */
283
-    public null|int $migrate_to_chat_id = null;
283
+    public null | int $migrate_to_chat_id = null;
284 284
 
285 285
     /**
286 286
      * Optional. The supergroup has been migrated from a group with the specified identifier. This number may have
@@ -288,123 +288,123 @@  discard block
 block discarded – undo
288 288
      * interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float
289 289
      * type are safe for storing this identifier.
290 290
      */
291
-    public null|int $migrate_from_chat_id = null;
291
+    public null | int $migrate_from_chat_id = null;
292 292
 
293 293
     /**
294 294
      * Optional. Specified message was pinned. Note that the Message object in this field will not contain further
295 295
      * reply_to_message fields even if it is itself a reply.
296 296
      */
297
-    public null|message $pinned_message = null;
297
+    public null | message $pinned_message = null;
298 298
 
299 299
     /** Optional. Message is an invoice for a payment, information about the invoice. More about payments » */
300
-    public null|invoice $invoice = null;
300
+    public null | invoice $invoice = null;
301 301
 
302 302
     /**
303 303
      * Optional. Message is a service message about a successful payment, information about the payment. More about
304 304
      * payments »
305 305
      */
306
-    public null|successfulPayment $successful_payment = null;
306
+    public null | successfulPayment $successful_payment = null;
307 307
 
308 308
     /** Optional. Service message: a user was shared with the bot */
309
-    public null|userShared $user_shared = null;
309
+    public null | userShared $user_shared = null;
310 310
 
311 311
     /** Optional. Service message: a chat was shared with the bot */
312
-    public null|chatShared $chat_shared = null;
312
+    public null | chatShared $chat_shared = null;
313 313
 
314 314
     /** Optional. The domain name of the website on which the user has logged in. More about Telegram Login » */
315
-    public null|string $connected_website = null;
315
+    public null | string $connected_website = null;
316 316
 
317 317
     /** Optional. Service message: the user allowed the bot added to the attachment menu to write messages */
318
-    public null|writeAccessAllowed $write_access_allowed = null;
318
+    public null | writeAccessAllowed $write_access_allowed = null;
319 319
 
320 320
     /** Optional. Telegram Passport data */
321
-    public null|passportData $passport_data = null;
321
+    public null | passportData $passport_data = null;
322 322
 
323 323
     /**
324 324
      * Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live
325 325
      * Location.
326 326
      */
327
-    public null|proximityAlertTriggered $proximity_alert_triggered = null;
327
+    public null | proximityAlertTriggered $proximity_alert_triggered = null;
328 328
 
329 329
     /** Optional. Service message: forum topic created */
330
-    public null|forumTopicCreated $forum_topic_created = null;
330
+    public null | forumTopicCreated $forum_topic_created = null;
331 331
 
332 332
     /** Optional. Service message: forum topic edited */
333
-    public null|forumTopicEdited $forum_topic_edited = null;
333
+    public null | forumTopicEdited $forum_topic_edited = null;
334 334
 
335 335
     /** Optional. Service message: forum topic closed */
336
-    public null|forumTopicClosed $forum_topic_closed = null;
336
+    public null | forumTopicClosed $forum_topic_closed = null;
337 337
 
338 338
     /** Optional. Service message: forum topic reopened */
339
-    public null|forumTopicReopened $forum_topic_reopened = null;
339
+    public null | forumTopicReopened $forum_topic_reopened = null;
340 340
 
341 341
     /** Optional. Service message: the 'General' forum topic hidden */
342
-    public null|generalForumTopicHidden $general_forum_topic_hidden = null;
342
+    public null | generalForumTopicHidden $general_forum_topic_hidden = null;
343 343
 
344 344
     /** Optional. Service message: the 'General' forum topic unhidden */
345
-    public null|generalForumTopicUnhidden $general_forum_topic_unhidden = null;
345
+    public null | generalForumTopicUnhidden $general_forum_topic_unhidden = null;
346 346
 
347 347
     /** Optional. Service message: video chat scheduled */
348
-    public null|videoChatScheduled $video_chat_scheduled = null;
348
+    public null | videoChatScheduled $video_chat_scheduled = null;
349 349
 
350 350
     /** Optional. Service message: video chat started */
351
-    public null|videoChatStarted $video_chat_started = null;
351
+    public null | videoChatStarted $video_chat_started = null;
352 352
 
353 353
     /** Optional. Service message: video chat ended */
354
-    public null|videoChatEnded $video_chat_ended = null;
354
+    public null | videoChatEnded $video_chat_ended = null;
355 355
 
356 356
     /** Optional. Service message: new participants invited to a video chat */
357
-    public null|videoChatParticipantsInvited $video_chat_participants_invited = null;
357
+    public null | videoChatParticipantsInvited $video_chat_participants_invited = null;
358 358
 
359 359
     /** Optional. Service message: data sent by a Web App */
360
-    public null|webAppData $web_app_data = null;
360
+    public null | webAppData $web_app_data = null;
361 361
 
362 362
     /** Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
363
-    public null|inlineKeyboardMarkup $reply_markup = null;
363
+    public null | inlineKeyboardMarkup $reply_markup = null;
364 364
 
365 365
 
366
-    public function __construct(stdClass|null $object = null) {
366
+    public function __construct(stdClass | null $object = null) {
367 367
         if ($object != null) {
368 368
             parent::__construct($object, self::subs);
369 369
         }
370 370
     }
371 371
 
372
-    public function isCommand (): bool {
372
+    public function isCommand(): bool {
373 373
         return !empty($this->command);
374 374
     }
375 375
 
376
-    public function isForwarded (): bool {
376
+    public function isForwarded(): bool {
377 377
         return $this->forward_from !== null || $this->forward_from_chat !== null;
378 378
     }
379 379
 
380
-    public function isAdmin (): bool {
380
+    public function isAdmin(): bool {
381 381
         return $this->chat->getMember($this->from->id)->status === chatMemberStatus::ADMINISTRATOR;
382 382
     }
383 383
 
384
-    public function isOwner (): bool {
384
+    public function isOwner(): bool {
385 385
         return $this->chat->getMember($this->from->id)->status === chatMemberStatus::CREATOR;
386 386
     }
387 387
 
388
-    public function banMember(): responseError|bool {
388
+    public function banMember(): responseError | bool {
389 389
         if ($this->chat->isPrivate()) {
390 390
             return false;
391 391
         }
392 392
         return telegram::banChatMember($this->chat->id, $this->from->id);
393 393
     }
394 394
 
395
-    public function delete (): responseError|bool {
396
-        return telegram::deleteMessage($this->chat->id,$this->id);
395
+    public function delete(): responseError | bool {
396
+        return telegram::deleteMessage($this->chat->id, $this->id);
397 397
     }
398 398
 
399
-    public function editText (string $text): message|responseError|bool {
400
-        return telegram::editMessageText($text,$this->chat->id,$this->message_id);
399
+    public function editText(string $text): message | responseError | bool {
400
+        return telegram::editMessageText($text, $this->chat->id, $this->message_id);
401 401
     }
402 402
 
403
-    public function copy (int|string $chat_id): messageId|responseError {
403
+    public function copy(int | string $chat_id): messageId | responseError {
404 404
         return telegram::copyMessage($chat_id);
405 405
     }
406 406
 
407
-    public function forward (int|string $chat_id): message|responseError {
407
+    public function forward(int | string $chat_id): message | responseError {
408 408
         return telegram::forwardMessage($chat_id);
409 409
     }
410 410
 }
Please login to merge, or discard this patch.
src/types/chatMember.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,64 +18,64 @@  discard block
 block discarded – undo
18 18
     public user $user;
19 19
 
20 20
     /** `creator` and `administrator` only. True, if the user's presence in the chat is hidden */
21
-    public null|bool $is_anonymous = null;
21
+    public null | bool $is_anonymous = null;
22 22
 
23 23
     /** `creator` and `administrator` only. Custom title for this user */
24
-    public null|string $custom_title = null;
24
+    public null | string $custom_title = null;
25 25
 
26 26
     /** `administrator` only. True, if the bot is allowed to edit administrator privileges of that user */
27
-    public null|bool $can_be_edited = null;
27
+    public null | bool $can_be_edited = null;
28 28
 
29 29
     /**
30 30
      * `administrator` only. True, if the administrator can access the chat event log, chat statistics, message statistics in
31 31
      * channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other
32 32
      * administrator privilege
33 33
      */
34
-    public null|bool $can_manage_chat = null;
34
+    public null | bool $can_manage_chat = null;
35 35
 
36 36
     /** `administrator` only. True, if the administrator can delete messages of other users */
37
-    public null|bool $can_delete_messages = null;
37
+    public null | bool $can_delete_messages = null;
38 38
 
39 39
     /** `administrator` only. True, if the administrator can manage video chats */
40
-    public null|bool $can_manage_video_chats = null;
40
+    public null | bool $can_manage_video_chats = null;
41 41
 
42 42
     /** `administrator` only. True, if the administrator can restrict, ban or unban chat members */
43
-    public null|bool $can_restrict_members = null;
43
+    public null | bool $can_restrict_members = null;
44 44
 
45 45
     /**
46 46
      * `administrator` only. if the administrator can add new administrators with a subset of their own privileges or demote
47 47
      * administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by
48 48
      * the user)
49 49
      */
50
-    public null|bool $can_promote_members = null;
50
+    public null | bool $can_promote_members = null;
51 51
 
52 52
     /** `administrator` and `restricted` only. True, if the user is allowed to change the chat title, photo and other settings */
53
-    public null|bool $can_change_info = null;
53
+    public null | bool $can_change_info = null;
54 54
 
55 55
     /** `administrator` and `restricted` only. True, if the user is allowed to invite new users to the chat */
56
-    public null|bool $can_invite_users = null;
56
+    public null | bool $can_invite_users = null;
57 57
 
58 58
     /** `administrator` only. Optional. True, if the administrator can post in the channel; channels only */
59
-    public null|bool $can_post_messages = null;
59
+    public null | bool $can_post_messages = null;
60 60
 
61 61
     /** `administrator` only. Optional. True, if the administrator can edit messages of other users and can pin messages; channels only */
62
-    public null|bool $can_edit_messages = null;
62
+    public null | bool $can_edit_messages = null;
63 63
 
64 64
     /** `administrator` and `restricted` only. Optional. True, if the user is allowed to pin messages; groups and supergroups only */
65
-    public null|bool $can_pin_messages = null;
65
+    public null | bool $can_pin_messages = null;
66 66
 
67 67
     /**
68 68
      * `administrator` : Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
69 69
      *
70 70
      * `restricted` : True, if the user is allowed to create forum topics
71 71
      */
72
-    public null|bool $can_manage_topics = null;
72
+    public null | bool $can_manage_topics = null;
73 73
 
74 74
     /** `restricted` only. True, if the user is a member of the chat at the moment of the request */
75
-    public null|bool $is_member = null;
75
+    public null | bool $is_member = null;
76 76
 
77 77
     /** `restricted` only. True, if the user is allowed to send text messages, contacts, locations and venues */
78
-    public null|bool $can_send_messages = null;
78
+    public null | bool $can_send_messages = null;
79 79
 
80 80
     /** `restricted` only. Optional. True, if the user is allowed to send audios */
81 81
     public bool $can_send_audios;
@@ -96,16 +96,16 @@  discard block
 block discarded – undo
96 96
     public bool $can_send_voice_notes;
97 97
 
98 98
     /** `restricted` only. True, if the user is allowed to send polls */
99
-    public null|bool $can_send_polls = null;
99
+    public null | bool $can_send_polls = null;
100 100
 
101 101
     /** `restricted` only. True, if the user is allowed to send animations, games, stickers and use inline bots */
102
-    public null|bool $can_send_other_messages = null;
102
+    public null | bool $can_send_other_messages = null;
103 103
 
104 104
     /** `restricted` only. True, if the user is allowed to add web page previews to their messages */
105
-    public null|bool $can_add_web_page_previews = null;
105
+    public null | bool $can_add_web_page_previews = null;
106 106
 
107 107
     /** `kicked` and `restricted` only. Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */
108
-    public null|int $until_date = null;
108
+    public null | int $until_date = null;
109 109
 
110 110
 
111 111
     public function __construct(stdClass $object) {
Please login to merge, or discard this patch.
src/types/userShared.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public int $user_id;
22 22
 
23 23
 
24
-    public function __construct(stdClass|null $object = null) {
24
+    public function __construct(stdClass | null $object = null) {
25 25
         if ($object != null) {
26 26
             parent::__construct($object, self::subs);
27 27
         }
Please login to merge, or discard this patch.
src/types/chatShared.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     public int $chat_id;
19 19
 
20 20
 
21
-    public function __construct(stdClass|null $object = null) {
21
+    public function __construct(stdClass | null $object = null) {
22 22
         if ($object != null) {
23 23
             parent::__construct($object, self::subs);
24 24
         }
Please login to merge, or discard this patch.