Passed
Push — develop ( 57a649...a01996 )
by Armando
33:04 queued 27:25
created

MessageReactionUpdated::subEntities()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

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
rs 10
1
<?php
2
3
namespace Longman\TelegramBot\Entities;
4
5
use Longman\TelegramBot\Entities\ReactionType\Factory as ReactionTypeFactory;
6
use Longman\TelegramBot\Entities\ReactionType\ReactionType;
7
8
/**
9
 * This object represents a change of a reaction on a message performed by a user.
10
 *
11
 * @link https://core.telegram.org/bots/api#messagereactionupdated
12
 *
13
 * @method Chat           getChat()        The chat containing the message the user reacted to
14
 * @method int            getMessageId()   Unique identifier of the message inside the chat
15
 * @method User           getUser()        Optional. The user that changed the reaction, if the user isn't anonymous
16
 * @method Chat           getActorChat()   Optional. The chat on behalf of which the reaction was changed, if the user is anonymous
17
 * @method int            getDate()        Date of the change in Unix time
18
 * @method ReactionType[] getOldReaction() Previous list of reaction types that were set by the user
19
 * @method ReactionType[] getNewReaction() New list of reaction types that have been set by the user
20
 */
21
class MessageReactionUpdated extends Entity
22
{
23
    protected function subEntities(): array
24
    {
25
        return [
26
            'chat'         => Chat::class,
27
            'user'         => User::class,
28
            'actor_chat'   => Chat::class,
29
            'old_reaction' => [ReactionTypeFactory::class],
30
            'new_reaction' => [ReactionTypeFactory::class],
31
        ];
32
    }
33
}
34