ChatMemberUpdated   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 14
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A subEntities() 0 8 1
1
<?php
2
3
namespace TelegramBot\Entities;
4
5
use TelegramBot\Entities\ChatMember\ChatMember;
6
use TelegramBot\Entities\ChatMember\Factory as ChatMemberFactory;
7
use TelegramBot\Entity;
8
9
/**
10
 * Class ChatMemberUpdated
11
 *
12
 * Represents changes in the status of a chat member
13
 *
14
 * @link https://core.telegram.org/bots/api#chatmemberupdated
15
 *
16
 * @method Chat            getChat()            Chat the user belongs to
17
 * @method User            getFrom()            Performer of the action, which resulted in the change
18
 * @method int             getDate()            Date the change was done in Unix time
19
 * @method ChatMember      getOldChatMember()   Previous information about the chat member
20
 * @method ChatMember      getNewChatMember()   New information about the chat member
21
 * @method ChatInviteLink  getInviteLink()      Optional. Chat invite link, which was used by the user to join the chat, for joining by invite link events only.
22
 */
23
class ChatMemberUpdated extends Entity
24
{
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    protected function subEntities(): array
30
    {
31
        return [
32
            'chat' => Chat::class,
33
            'from' => User::class,
34
            'old_chat_member' => ChatMemberFactory::class,
35
            'new_chat_member' => ChatMemberFactory::class,
36
            'invite_link' => ChatInviteLink::class,
37
        ];
38
    }
39
40
}
41