Passed
Push — master ( 26433b...596cc9 )
by Armando
16:00 queued 05:59
created

MessageReactionUpdated   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A subEntities() 0 8 1
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