Passed
Push — master ( 9ca615...b6ea35 )
by Armando
02:47
created

ChatMemberUpdated::subEntities()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
/**
4
 * This file is part of the TelegramBot package.
5
 *
6
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Longman\TelegramBot\Entities;
13
14
/**
15
 * Class ChatMemberUpdated
16
 *
17
 * Represents changes in the status of a chat member
18
 *
19
 * @link https://core.telegram.org/bots/api#chatmemberupdated
20
 *
21
 * @method Chat            getChat()              Chat the user belongs to
22
 * @method User            getFrom()              Performer of the action, which resulted in the change
23
 * @method int             getDate()              Date the change was done in Unix time
24
 * @method ChatMember      getOldChatMember()     Previous information about the chat member
25
 * @method ChatMember      getNewChatMember()     New information about the chat member
26
 * @method ChatInviteLink  getInviteLink()        Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
27
 */
28
class ChatMemberUpdated extends Entity
29
{
30
    /**
31
     * {@inheritdoc}
32
     */
33
    protected function subEntities(): array
34
    {
35
        return [
36
            'chat'            => Chat::class,
37
            'from'            => User::class,
38
            'old_chat_member' => ChatMember::class,
39
            'new_chat_member' => ChatMember::class,
40
            'invite_link'     => ChatInviteLink::class,
41
        ];
42
    }
43
}
44