PollAnswer::subEntities()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 4
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 PollAnswer
16
 *
17
 * This entity represents an answer of a user in a non-anonymous poll.
18
 *
19
 * @link https://core.telegram.org/bots/api#pollanswer
20
 *
21
 * @method string getPollId()    Unique poll identifier
22
 * @method Chat   getVoterChat() Optional. The chat that changed the answer to the poll, if the voter is anonymous
23
 * @method User   getUser()      Optional. The user, who changed the answer to the poll
24
 * @method array  getOptionIds() 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
25
 */
26
class PollAnswer extends Entity
27
{
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function subEntities(): array
32
    {
33
        return [
34
            'voter_chat' => Chat::class,
35
            'user'       => User::class,
36
        ];
37
    }
38
}
39