From 54ccc05267f00f1b6e5d249a95dfb98ff2ee35d7 Mon Sep 17 00:00:00 2001 From: Ali Raghebi Date: Tue, 31 Mar 2020 23:06:30 +0430 Subject: [PATCH 1/7] added poll type --- .gitignore | 3 +- src/Objects/Message.php | 146 ++++++++++++++++++++-------------------- 2 files changed, 76 insertions(+), 73 deletions(-) diff --git a/.gitignore b/.gitignore index 189d7da8..f0875c33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ composer.phar composer.lock vendor/ -build/ \ No newline at end of file +build/ +.idea/ diff --git a/src/Objects/Message.php b/src/Objects/Message.php index 84a92264..61707581 100644 --- a/src/Objects/Message.php +++ b/src/Objects/Message.php @@ -9,53 +9,53 @@ /** * Class Message. * - * @property int $messageId Unique message identifier. - * @property User $from (Optional). Sender, can be empty for messages sent to channels. - * @property int $date Date the message was sent in Unix time. - * @property Chat $chat Conversation the message belongs to. - * @property User $forwardFrom (Optional). For forwarded messages, sender of the original message. - * @property Chat $forwardFromChat (Optional). For messages forwarded from a channel, information about the original channel. - * @property int $forwardFromMessageId (Optional). For forwarded channel posts, identifier of the original message in the channel. - * @property string $forwardSignature (Optional). For messages forwarded from channels, identifier of the original message in the channel - * @property string $forwardSenderName (Optional). Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages - * @property int $forwardDate (Optional). For forwarded messages, date the original message was sent in Unix time. - * @property Message $replyToMessage (Optional). For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. - * @property int $editDate (Optional). Date the message was last edited in Unix time. - * @property string $mediaGroupId (Optional). The unique identifier of a media message group this message belongs to - * @property string $authorSignature (Optional). Signature of the post author for messages in channels - * @property string $text (Optional). For text messages, the actual UTF-8 text of the message, 0-4096 characters. - * @property MessageEntity[] $entities (Optional). For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. - * @property MessageEntity[] $captionEntities (Optional). For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption. - * @property Audio $audio (Optional). Message is an audio file, information about the file. - * @property Document $document (Optional). Message is a general file, information about the file. - * @property Animation $animation (Optional). Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set - * @property Game $game (Optional). Message is a game, information about the game. - * @property PhotoSize[] $photo (Optional). Message is a photo, available sizes of the photo. - * @property Sticker $sticker (Optional). Message is a sticker, information about the sticker. - * @property Video $video (Optional). Message is a video, information about the video. - * @property Voice $voice (Optional). Message is a voice message, information about the file. - * @property VideoNote $videoNote (Optional). Message is a video note, information about the video message. - * @property string $caption (Optional). Caption for the document, photo or video, 0-200 characters. - * @property Contact $contact (Optional). Message is a shared contact, information about the contact. - * @property Location $location (Optional). Message is a shared location, information about the location. - * @property Venue $venue (Optional). Message is a venue, information about the venue. - * @property Poll $poll (Optional). Message is a native poll, information about the poll - * @property User[] $newChatMembers (Optional). New members that were added to the group or supergroup and information about them (the bot itself may be one of these members). - * @property User $leftChatMember (Optional). A member was removed from the group, information about them (this member may be the bot itself). - * @property string $newChatTitle (Optional). A chat title was changed to this value. - * @property PhotoSize[] $newChatPhoto (Optional). A chat photo was change to this value. - * @property bool $deleteChatPhoto (Optional). Service message: the chat photo was deleted. - * @property bool $groupChatCreated (Optional). Service message: the group has been created. - * @property bool $supergroupChatCreated (Optional). Service message: the super group has been created. - * @property bool $channelChatCreated (Optional). Service message: the channel has been created. - * @property int $migrateToChatId (Optional). The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value. - * @property int $migrateFromChatId (Optional). The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value. - * @property Message $pinnedMessage (Optional). Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. - * @property Invoice $invoice (Optional). Message is an invoice for a payment, information about the invoice. + * @property int $messageId Unique message identifier. + * @property User $from (Optional). Sender, can be empty for messages sent to channels. + * @property int $date Date the message was sent in Unix time. + * @property Chat $chat Conversation the message belongs to. + * @property User $forwardFrom (Optional). For forwarded messages, sender of the original message. + * @property Chat $forwardFromChat (Optional). For messages forwarded from a channel, information about the original channel. + * @property int $forwardFromMessageId (Optional). For forwarded channel posts, identifier of the original message in the channel. + * @property string $forwardSignature (Optional). For messages forwarded from channels, identifier of the original message in the channel + * @property string $forwardSenderName (Optional). Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages + * @property int $forwardDate (Optional). For forwarded messages, date the original message was sent in Unix time. + * @property Message $replyToMessage (Optional). For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. + * @property int $editDate (Optional). Date the message was last edited in Unix time. + * @property string $mediaGroupId (Optional). The unique identifier of a media message group this message belongs to + * @property string $authorSignature (Optional). Signature of the post author for messages in channels + * @property string $text (Optional). For text messages, the actual UTF-8 text of the message, 0-4096 characters. + * @property MessageEntity[] $entities (Optional). For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. + * @property MessageEntity[] $captionEntities (Optional). For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption. + * @property Audio $audio (Optional). Message is an audio file, information about the file. + * @property Document $document (Optional). Message is a general file, information about the file. + * @property Animation $animation (Optional). Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set + * @property Game $game (Optional). Message is a game, information about the game. + * @property PhotoSize[] $photo (Optional). Message is a photo, available sizes of the photo. + * @property Sticker $sticker (Optional). Message is a sticker, information about the sticker. + * @property Video $video (Optional). Message is a video, information about the video. + * @property Voice $voice (Optional). Message is a voice message, information about the file. + * @property VideoNote $videoNote (Optional). Message is a video note, information about the video message. + * @property string $caption (Optional). Caption for the document, photo or video, 0-200 characters. + * @property Contact $contact (Optional). Message is a shared contact, information about the contact. + * @property Location $location (Optional). Message is a shared location, information about the location. + * @property Venue $venue (Optional). Message is a venue, information about the venue. + * @property Poll $poll (Optional). Message is a native poll, information about the poll + * @property User[] $newChatMembers (Optional). New members that were added to the group or supergroup and information about them (the bot itself may be one of these members). + * @property User $leftChatMember (Optional). A member was removed from the group, information about them (this member may be the bot itself). + * @property string $newChatTitle (Optional). A chat title was changed to this value. + * @property PhotoSize[] $newChatPhoto (Optional). A chat photo was change to this value. + * @property bool $deleteChatPhoto (Optional). Service message: the chat photo was deleted. + * @property bool $groupChatCreated (Optional). Service message: the group has been created. + * @property bool $supergroupChatCreated (Optional). Service message: the super group has been created. + * @property bool $channelChatCreated (Optional). Service message: the channel has been created. + * @property int $migrateToChatId (Optional). The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value. + * @property int $migrateFromChatId (Optional). The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value. + * @property Message $pinnedMessage (Optional). Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. + * @property Invoice $invoice (Optional). Message is an invoice for a payment, information about the invoice. * @property SuccessfulPayment $successfulPayment (Optional). Message is a service message about a successful payment, information about the payment. - * @property string $connectedWebsite (Optional). The domain name of the website on which the user has logged in. - * @property PassportData $passportData (Optional). Telegram Passport data - * @property string $replyMarkup (Optional). Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. + * @property string $connectedWebsite (Optional). The domain name of the website on which the user has logged in. + * @property PassportData $passportData (Optional). Telegram Passport data + * @property string $replyMarkup (Optional). Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */ class Message extends BaseObject { @@ -65,32 +65,33 @@ class Message extends BaseObject public function relations() { return [ - 'from' => User::class, - 'chat' => Chat::class, - 'forward_from' => User::class, - 'forward_from_chat' => Chat::class, - 'reply_to_message' => self::class, - 'entities' => MessageEntity::class, - 'caption_entities' => MessageEntity::class, - 'audio' => Audio::class, - 'document' => Document::class, - 'animation' => Animation::class, - 'game' => Game::class, - 'photo' => PhotoSize::class, - 'sticker' => Sticker::class, - 'video' => Video::class, - 'voice' => Voice::class, - 'video_note' => VideoNote::class, - 'contact' => Contact::class, - 'location' => Location::class, - 'venue' => Venue::class, - 'new_chat_members' => User::class, - 'left_chat_member' => User::class, - 'new_chat_photo' => PhotoSize::class, - 'pinned_message' => self::class, - 'invoice' => Invoice::class, + 'from' => User::class, + 'chat' => Chat::class, + 'forward_from' => User::class, + 'forward_from_chat' => Chat::class, + 'reply_to_message' => self::class, + 'entities' => MessageEntity::class, + 'caption_entities' => MessageEntity::class, + 'audio' => Audio::class, + 'document' => Document::class, + 'animation' => Animation::class, + 'game' => Game::class, + 'photo' => PhotoSize::class, + 'sticker' => Sticker::class, + 'video' => Video::class, + 'voice' => Voice::class, + 'video_note' => VideoNote::class, + 'contact' => Contact::class, + 'location' => Location::class, + 'venue' => Venue::class, + 'poll' => Poll::class, + 'new_chat_members' => User::class, + 'left_chat_member' => User::class, + 'new_chat_photo' => PhotoSize::class, + 'pinned_message' => self::class, + 'invoice' => Invoice::class, 'successful_payment' => SuccessfulPayment::class, - 'passport' => PassportData::class, + 'passport' => PassportData::class, ]; } @@ -129,6 +130,7 @@ public function detectType() 'contact', 'location', 'venue', + 'poll', 'new_chat_member', 'left_chat_member', 'new_chat_title', @@ -154,6 +156,6 @@ public function detectType() */ public function hasCommand() { - return (bool) $this->get('entities', collect())->contains('type', 'bot_command'); + return (bool)$this->get('entities', collect())->contains('type', 'bot_command'); } } From 54034fbad4ad406042881bbcfef40258f28c97a2 Mon Sep 17 00:00:00 2001 From: Ali Raghebi Date: Tue, 31 Mar 2020 23:17:45 +0430 Subject: [PATCH 2/7] complete poll object properties --- src/Objects/Poll.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Objects/Poll.php b/src/Objects/Poll.php index 1caf0881..aed6e198 100644 --- a/src/Objects/Poll.php +++ b/src/Objects/Poll.php @@ -6,10 +6,15 @@ * Class Poll. * * - * @property string $id Unique poll identifier - * @property string $question Poll question, 1-255 characters. - * @property PollOption[] $options List of poll options - * @property bool $isClosed True, if the poll is closed. + * @property string $id Unique poll identifier + * @property string $question Poll question, 1-255 characters. + * @property PollOption[] $options List of poll options + * @property int $totalVoterCount Total number of users that voted in the poll + * @property bool $isClosed True, if the poll is closed. + * @property bool $isAnonymous True, if the poll is anonymous. + * @property string $type Poll type, currently can be “regular” or “quiz” + * @property bool $allowMultipleAnswers True, if the poll allows multiple answers. + * @property int $correctOptionId Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */ class Poll extends BaseObject { From 1ee56282b8067d0ef335e7570e0db44d4b694c76 Mon Sep 17 00:00:00 2001 From: Ali Raghebi Date: Wed, 1 Apr 2020 17:08:45 +0430 Subject: [PATCH 3/7] fixed space --- src/Objects/Message.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Objects/Message.php b/src/Objects/Message.php index 61707581..ddce9a7e 100644 --- a/src/Objects/Message.php +++ b/src/Objects/Message.php @@ -98,7 +98,7 @@ public function relations() /** * Determine if the message is of given type. * - * @param string $type + * @param string $type * * @return bool */ @@ -156,6 +156,6 @@ public function detectType() */ public function hasCommand() { - return (bool)$this->get('entities', collect())->contains('type', 'bot_command'); + return (bool) $this->get('entities', collect())->contains('type', 'bot_command'); } } From d59cd54e13bf293844d457968c3e9c14f44d8c34 Mon Sep 17 00:00:00 2001 From: Ali Raghebi Date: Sat, 11 Apr 2020 18:19:18 +0430 Subject: [PATCH 4/7] removed idea folder from gitignore file and add it to global gitignore file --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index f0875c33..e80fb635 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ composer.phar composer.lock vendor/ build/ -.idea/ From 184643c2be9da512e6e0827990c5e6a3957f87eb Mon Sep 17 00:00:00 2001 From: Ali Raghebi Date: Sat, 11 Apr 2020 18:49:24 +0430 Subject: [PATCH 5/7] solved code style problems --- src/Objects/Message.php | 145 ++++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/src/Objects/Message.php b/src/Objects/Message.php index ddce9a7e..a00f49c2 100644 --- a/src/Objects/Message.php +++ b/src/Objects/Message.php @@ -9,89 +9,90 @@ /** * Class Message. * - * @property int $messageId Unique message identifier. - * @property User $from (Optional). Sender, can be empty for messages sent to channels. - * @property int $date Date the message was sent in Unix time. - * @property Chat $chat Conversation the message belongs to. - * @property User $forwardFrom (Optional). For forwarded messages, sender of the original message. - * @property Chat $forwardFromChat (Optional). For messages forwarded from a channel, information about the original channel. - * @property int $forwardFromMessageId (Optional). For forwarded channel posts, identifier of the original message in the channel. - * @property string $forwardSignature (Optional). For messages forwarded from channels, identifier of the original message in the channel - * @property string $forwardSenderName (Optional). Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages - * @property int $forwardDate (Optional). For forwarded messages, date the original message was sent in Unix time. - * @property Message $replyToMessage (Optional). For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. - * @property int $editDate (Optional). Date the message was last edited in Unix time. - * @property string $mediaGroupId (Optional). The unique identifier of a media message group this message belongs to - * @property string $authorSignature (Optional). Signature of the post author for messages in channels - * @property string $text (Optional). For text messages, the actual UTF-8 text of the message, 0-4096 characters. - * @property MessageEntity[] $entities (Optional). For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. - * @property MessageEntity[] $captionEntities (Optional). For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption. - * @property Audio $audio (Optional). Message is an audio file, information about the file. - * @property Document $document (Optional). Message is a general file, information about the file. - * @property Animation $animation (Optional). Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set - * @property Game $game (Optional). Message is a game, information about the game. - * @property PhotoSize[] $photo (Optional). Message is a photo, available sizes of the photo. - * @property Sticker $sticker (Optional). Message is a sticker, information about the sticker. - * @property Video $video (Optional). Message is a video, information about the video. - * @property Voice $voice (Optional). Message is a voice message, information about the file. - * @property VideoNote $videoNote (Optional). Message is a video note, information about the video message. - * @property string $caption (Optional). Caption for the document, photo or video, 0-200 characters. - * @property Contact $contact (Optional). Message is a shared contact, information about the contact. - * @property Location $location (Optional). Message is a shared location, information about the location. - * @property Venue $venue (Optional). Message is a venue, information about the venue. - * @property Poll $poll (Optional). Message is a native poll, information about the poll - * @property User[] $newChatMembers (Optional). New members that were added to the group or supergroup and information about them (the bot itself may be one of these members). - * @property User $leftChatMember (Optional). A member was removed from the group, information about them (this member may be the bot itself). - * @property string $newChatTitle (Optional). A chat title was changed to this value. - * @property PhotoSize[] $newChatPhoto (Optional). A chat photo was change to this value. - * @property bool $deleteChatPhoto (Optional). Service message: the chat photo was deleted. - * @property bool $groupChatCreated (Optional). Service message: the group has been created. - * @property bool $supergroupChatCreated (Optional). Service message: the super group has been created. - * @property bool $channelChatCreated (Optional). Service message: the channel has been created. - * @property int $migrateToChatId (Optional). The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value. - * @property int $migrateFromChatId (Optional). The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value. - * @property Message $pinnedMessage (Optional). Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. - * @property Invoice $invoice (Optional). Message is an invoice for a payment, information about the invoice. + * @property int $messageId Unique message identifier. + * @property User $from (Optional). Sender, can be empty for messages sent to channels. + * @property int $date Date the message was sent in Unix time. + * @property Chat $chat Conversation the message belongs to. + * @property User $forwardFrom (Optional). For forwarded messages, sender of the original message. + * @property Chat $forwardFromChat (Optional). For messages forwarded from a channel, information about the original channel. + * @property int $forwardFromMessageId (Optional). For forwarded channel posts, identifier of the original message in the channel. + * @property string $forwardSignature (Optional). For messages forwarded from channels, identifier of the original message in the channel + * @property string $forwardSenderName (Optional). Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages + * @property int $forwardDate (Optional). For forwarded messages, date the original message was sent in Unix time. + * @property Message $replyToMessage (Optional). For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. + * @property int $editDate (Optional). Date the message was last edited in Unix time. + * @property string $mediaGroupId (Optional). The unique identifier of a media message group this message belongs to + * @property string $authorSignature (Optional). Signature of the post author for messages in channels + * @property string $text (Optional). For text messages, the actual UTF-8 text of the message, 0-4096 characters. + * @property MessageEntity[] $entities (Optional). For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. + * @property MessageEntity[] $captionEntities (Optional). For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption. + * @property Audio $audio (Optional). Message is an audio file, information about the file. + * @property Document $document (Optional). Message is a general file, information about the file. + * @property Animation $animation (Optional). Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set + * @property Game $game (Optional). Message is a game, information about the game. + * @property PhotoSize[] $photo (Optional). Message is a photo, available sizes of the photo. + * @property Sticker $sticker (Optional). Message is a sticker, information about the sticker. + * @property Video $video (Optional). Message is a video, information about the video. + * @property Voice $voice (Optional). Message is a voice message, information about the file. + * @property VideoNote $videoNote (Optional). Message is a video note, information about the video message. + * @property string $caption (Optional). Caption for the document, photo or video, 0-200 characters. + * @property Contact $contact (Optional). Message is a shared contact, information about the contact. + * @property Location $location (Optional). Message is a shared location, information about the location. + * @property Venue $venue (Optional). Message is a venue, information about the venue. + * @property Poll $poll (Optional). Message is a native poll, information about the poll + * @property User[] $newChatMembers (Optional). New members that were added to the group or supergroup and information about them (the bot itself may be one of these members). + * @property User $leftChatMember (Optional). A member was removed from the group, information about them (this member may be the bot itself). + * @property string $newChatTitle (Optional). A chat title was changed to this value. + * @property PhotoSize[] $newChatPhoto (Optional). A chat photo was change to this value. + * @property bool $deleteChatPhoto (Optional). Service message: the chat photo was deleted. + * @property bool $groupChatCreated (Optional). Service message: the group has been created. + * @property bool $supergroupChatCreated (Optional). Service message: the super group has been created. + * @property bool $channelChatCreated (Optional). Service message: the channel has been created. + * @property int $migrateToChatId (Optional). The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value. + * @property int $migrateFromChatId (Optional). The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value. + * @property Message $pinnedMessage (Optional). Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. + * @property Invoice $invoice (Optional). Message is an invoice for a payment, information about the invoice. * @property SuccessfulPayment $successfulPayment (Optional). Message is a service message about a successful payment, information about the payment. - * @property string $connectedWebsite (Optional). The domain name of the website on which the user has logged in. - * @property PassportData $passportData (Optional). Telegram Passport data - * @property string $replyMarkup (Optional). Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. + * @property string $connectedWebsite (Optional). The domain name of the website on which the user has logged in. + * @property PassportData $passportData (Optional). Telegram Passport data + * @property string $replyMarkup (Optional). Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */ class Message extends BaseObject { + /** * {@inheritdoc} */ public function relations() { return [ - 'from' => User::class, - 'chat' => Chat::class, - 'forward_from' => User::class, - 'forward_from_chat' => Chat::class, - 'reply_to_message' => self::class, - 'entities' => MessageEntity::class, - 'caption_entities' => MessageEntity::class, - 'audio' => Audio::class, - 'document' => Document::class, - 'animation' => Animation::class, - 'game' => Game::class, - 'photo' => PhotoSize::class, - 'sticker' => Sticker::class, - 'video' => Video::class, - 'voice' => Voice::class, - 'video_note' => VideoNote::class, - 'contact' => Contact::class, - 'location' => Location::class, - 'venue' => Venue::class, - 'poll' => Poll::class, - 'new_chat_members' => User::class, - 'left_chat_member' => User::class, - 'new_chat_photo' => PhotoSize::class, - 'pinned_message' => self::class, - 'invoice' => Invoice::class, + 'from' => User::class, + 'chat' => Chat::class, + 'forward_from' => User::class, + 'forward_from_chat' => Chat::class, + 'reply_to_message' => self::class, + 'entities' => MessageEntity::class, + 'caption_entities' => MessageEntity::class, + 'audio' => Audio::class, + 'document' => Document::class, + 'animation' => Animation::class, + 'game' => Game::class, + 'photo' => PhotoSize::class, + 'sticker' => Sticker::class, + 'video' => Video::class, + 'voice' => Voice::class, + 'video_note' => VideoNote::class, + 'contact' => Contact::class, + 'location' => Location::class, + 'venue' => Venue::class, + 'poll' => Poll::class, + 'new_chat_members' => User::class, + 'left_chat_member' => User::class, + 'new_chat_photo' => PhotoSize::class, + 'pinned_message' => self::class, + 'invoice' => Invoice::class, 'successful_payment' => SuccessfulPayment::class, - 'passport' => PassportData::class, + 'passport' => PassportData::class, ]; } From 753d7d8fd8180685df2294b0b0f4c184bf1b4b9f Mon Sep 17 00:00:00 2001 From: Ali Raghebi Date: Sat, 11 Apr 2020 18:51:06 +0430 Subject: [PATCH 6/7] solved code style problems --- src/Objects/Message.php | 144 ++++++++++++++++++++-------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/src/Objects/Message.php b/src/Objects/Message.php index ddce9a7e..31b492e7 100644 --- a/src/Objects/Message.php +++ b/src/Objects/Message.php @@ -9,53 +9,53 @@ /** * Class Message. * - * @property int $messageId Unique message identifier. - * @property User $from (Optional). Sender, can be empty for messages sent to channels. - * @property int $date Date the message was sent in Unix time. - * @property Chat $chat Conversation the message belongs to. - * @property User $forwardFrom (Optional). For forwarded messages, sender of the original message. - * @property Chat $forwardFromChat (Optional). For messages forwarded from a channel, information about the original channel. - * @property int $forwardFromMessageId (Optional). For forwarded channel posts, identifier of the original message in the channel. - * @property string $forwardSignature (Optional). For messages forwarded from channels, identifier of the original message in the channel - * @property string $forwardSenderName (Optional). Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages - * @property int $forwardDate (Optional). For forwarded messages, date the original message was sent in Unix time. - * @property Message $replyToMessage (Optional). For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. - * @property int $editDate (Optional). Date the message was last edited in Unix time. - * @property string $mediaGroupId (Optional). The unique identifier of a media message group this message belongs to - * @property string $authorSignature (Optional). Signature of the post author for messages in channels - * @property string $text (Optional). For text messages, the actual UTF-8 text of the message, 0-4096 characters. - * @property MessageEntity[] $entities (Optional). For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. - * @property MessageEntity[] $captionEntities (Optional). For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption. - * @property Audio $audio (Optional). Message is an audio file, information about the file. - * @property Document $document (Optional). Message is a general file, information about the file. - * @property Animation $animation (Optional). Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set - * @property Game $game (Optional). Message is a game, information about the game. - * @property PhotoSize[] $photo (Optional). Message is a photo, available sizes of the photo. - * @property Sticker $sticker (Optional). Message is a sticker, information about the sticker. - * @property Video $video (Optional). Message is a video, information about the video. - * @property Voice $voice (Optional). Message is a voice message, information about the file. - * @property VideoNote $videoNote (Optional). Message is a video note, information about the video message. - * @property string $caption (Optional). Caption for the document, photo or video, 0-200 characters. - * @property Contact $contact (Optional). Message is a shared contact, information about the contact. - * @property Location $location (Optional). Message is a shared location, information about the location. - * @property Venue $venue (Optional). Message is a venue, information about the venue. - * @property Poll $poll (Optional). Message is a native poll, information about the poll - * @property User[] $newChatMembers (Optional). New members that were added to the group or supergroup and information about them (the bot itself may be one of these members). - * @property User $leftChatMember (Optional). A member was removed from the group, information about them (this member may be the bot itself). - * @property string $newChatTitle (Optional). A chat title was changed to this value. - * @property PhotoSize[] $newChatPhoto (Optional). A chat photo was change to this value. - * @property bool $deleteChatPhoto (Optional). Service message: the chat photo was deleted. - * @property bool $groupChatCreated (Optional). Service message: the group has been created. - * @property bool $supergroupChatCreated (Optional). Service message: the super group has been created. - * @property bool $channelChatCreated (Optional). Service message: the channel has been created. - * @property int $migrateToChatId (Optional). The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value. - * @property int $migrateFromChatId (Optional). The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value. - * @property Message $pinnedMessage (Optional). Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. - * @property Invoice $invoice (Optional). Message is an invoice for a payment, information about the invoice. + * @property int $messageId Unique message identifier. + * @property User $from (Optional). Sender, can be empty for messages sent to channels. + * @property int $date Date the message was sent in Unix time. + * @property Chat $chat Conversation the message belongs to. + * @property User $forwardFrom (Optional). For forwarded messages, sender of the original message. + * @property Chat $forwardFromChat (Optional). For messages forwarded from a channel, information about the original channel. + * @property int $forwardFromMessageId (Optional). For forwarded channel posts, identifier of the original message in the channel. + * @property string $forwardSignature (Optional). For messages forwarded from channels, identifier of the original message in the channel + * @property string $forwardSenderName (Optional). Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages + * @property int $forwardDate (Optional). For forwarded messages, date the original message was sent in Unix time. + * @property Message $replyToMessage (Optional). For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. + * @property int $editDate (Optional). Date the message was last edited in Unix time. + * @property string $mediaGroupId (Optional). The unique identifier of a media message group this message belongs to + * @property string $authorSignature (Optional). Signature of the post author for messages in channels + * @property string $text (Optional). For text messages, the actual UTF-8 text of the message, 0-4096 characters. + * @property MessageEntity[] $entities (Optional). For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. + * @property MessageEntity[] $captionEntities (Optional). For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption. + * @property Audio $audio (Optional). Message is an audio file, information about the file. + * @property Document $document (Optional). Message is a general file, information about the file. + * @property Animation $animation (Optional). Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set + * @property Game $game (Optional). Message is a game, information about the game. + * @property PhotoSize[] $photo (Optional). Message is a photo, available sizes of the photo. + * @property Sticker $sticker (Optional). Message is a sticker, information about the sticker. + * @property Video $video (Optional). Message is a video, information about the video. + * @property Voice $voice (Optional). Message is a voice message, information about the file. + * @property VideoNote $videoNote (Optional). Message is a video note, information about the video message. + * @property string $caption (Optional). Caption for the document, photo or video, 0-200 characters. + * @property Contact $contact (Optional). Message is a shared contact, information about the contact. + * @property Location $location (Optional). Message is a shared location, information about the location. + * @property Venue $venue (Optional). Message is a venue, information about the venue. + * @property Poll $poll (Optional). Message is a native poll, information about the poll + * @property User[] $newChatMembers (Optional). New members that were added to the group or supergroup and information about them (the bot itself may be one of these members). + * @property User $leftChatMember (Optional). A member was removed from the group, information about them (this member may be the bot itself). + * @property string $newChatTitle (Optional). A chat title was changed to this value. + * @property PhotoSize[] $newChatPhoto (Optional). A chat photo was change to this value. + * @property bool $deleteChatPhoto (Optional). Service message: the chat photo was deleted. + * @property bool $groupChatCreated (Optional). Service message: the group has been created. + * @property bool $supergroupChatCreated (Optional). Service message: the super group has been created. + * @property bool $channelChatCreated (Optional). Service message: the channel has been created. + * @property int $migrateToChatId (Optional). The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value. + * @property int $migrateFromChatId (Optional). The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value. + * @property Message $pinnedMessage (Optional). Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. + * @property Invoice $invoice (Optional). Message is an invoice for a payment, information about the invoice. * @property SuccessfulPayment $successfulPayment (Optional). Message is a service message about a successful payment, information about the payment. - * @property string $connectedWebsite (Optional). The domain name of the website on which the user has logged in. - * @property PassportData $passportData (Optional). Telegram Passport data - * @property string $replyMarkup (Optional). Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. + * @property string $connectedWebsite (Optional). The domain name of the website on which the user has logged in. + * @property PassportData $passportData (Optional). Telegram Passport data + * @property string $replyMarkup (Optional). Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */ class Message extends BaseObject { @@ -65,33 +65,33 @@ class Message extends BaseObject public function relations() { return [ - 'from' => User::class, - 'chat' => Chat::class, - 'forward_from' => User::class, - 'forward_from_chat' => Chat::class, - 'reply_to_message' => self::class, - 'entities' => MessageEntity::class, - 'caption_entities' => MessageEntity::class, - 'audio' => Audio::class, - 'document' => Document::class, - 'animation' => Animation::class, - 'game' => Game::class, - 'photo' => PhotoSize::class, - 'sticker' => Sticker::class, - 'video' => Video::class, - 'voice' => Voice::class, - 'video_note' => VideoNote::class, - 'contact' => Contact::class, - 'location' => Location::class, - 'venue' => Venue::class, - 'poll' => Poll::class, - 'new_chat_members' => User::class, - 'left_chat_member' => User::class, - 'new_chat_photo' => PhotoSize::class, - 'pinned_message' => self::class, - 'invoice' => Invoice::class, + 'from' => User::class, + 'chat' => Chat::class, + 'forward_from' => User::class, + 'forward_from_chat' => Chat::class, + 'reply_to_message' => self::class, + 'entities' => MessageEntity::class, + 'caption_entities' => MessageEntity::class, + 'audio' => Audio::class, + 'document' => Document::class, + 'animation' => Animation::class, + 'game' => Game::class, + 'photo' => PhotoSize::class, + 'sticker' => Sticker::class, + 'video' => Video::class, + 'voice' => Voice::class, + 'video_note' => VideoNote::class, + 'contact' => Contact::class, + 'location' => Location::class, + 'venue' => Venue::class, + 'poll' => Poll::class, + 'new_chat_members' => User::class, + 'left_chat_member' => User::class, + 'new_chat_photo' => PhotoSize::class, + 'pinned_message' => self::class, + 'invoice' => Invoice::class, 'successful_payment' => SuccessfulPayment::class, - 'passport' => PassportData::class, + 'passport' => PassportData::class, ]; } From ce5728f606fd49f52222c4f0d7c5877aa7ed0abf Mon Sep 17 00:00:00 2001 From: Ali Raghebi Date: Sat, 11 Apr 2020 18:52:26 +0430 Subject: [PATCH 7/7] solved code style problems --- src/Objects/Message.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Objects/Message.php b/src/Objects/Message.php index a00f49c2..31b492e7 100644 --- a/src/Objects/Message.php +++ b/src/Objects/Message.php @@ -59,7 +59,6 @@ */ class Message extends BaseObject { - /** * {@inheritdoc} */