Пожалуйста объясните что делает этот код. И откуда там взялись методы указанные в PHPDoc, они и в правду работают, но я их не вижу ни в самом классе, ни в классе от которого он наследуется (см. оригинал на гитхабе пожалуйста).
protected function subEntities(): array
{
return [
'from' => User::class,
'sender_chat' => Chat::class,
'chat' => Chat::class,
'forward_from' => User::class,
'forward_from_chat' => Chat::class,
'reply_to_message' => ReplyToMessage::class,
'via_bot' => User::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,
'dice' => Dice::class,
'new_chat_members' => [User::class],
'left_chat_member' => User::class,
'new_chat_photo' => [PhotoSize::class],
'message_auto_delete_timer_changed' => MessageAutoDeleteTimerChanged::class,
'pinned_message' => __CLASS__,
'invoice' => Invoice::class,
'successful_payment' => SuccessfulPayment::class,
'passport_data' => PassportData::class,
'proximity_alert_triggered' => ProximityAlertTriggered::class,
'voice_chat_scheduled' => VoiceChatScheduled::class, // deprecated
'voice_chat_started' => VoiceChatStarted::class, // deprecated
'voice_chat_ended' => VoiceChatEnded::class, // deprecated
'voice_chat_participants_invited' => VoiceChatParticipantsInvited::class, // deprecated
'video_chat_scheduled' => VideoChatScheduled::class,
'video_chat_started' => VideoChatStarted::class,
'video_chat_ended' => VideoChatEnded::class,
'video_chat_participants_invited' => VideoChatParticipantsInvited::class,
'web_app_data' => WebAppData::class,
'reply_markup' => InlineKeyboard::class,
];
}
оригинал:
https://github.com/php-telegram-bot/core/blob/deve...