Poll   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 11
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A subEntities() 0 5 1
1
<?php
2
3
4
namespace TelegramBot\Entities;
5
6
use TelegramBot\Entity;
7
8
/**
9
 * Class Poll
10
 *
11
 * This entity contains information about a poll.
12
 *
13
 * @link https://core.telegram.org/bots/api#poll
14
 *
15
 * @method string          getId()                    Unique poll identifier
16
 * @method string          getQuestion()              Poll question, 1-255 characters
17
 * @method PollOption[]    getOptions()               List of poll options
18
 * @method int             getTotalVoterCount()       Total number of users that voted in the poll
19
 * @method bool            getIsClosed()              True, if the poll is closed
20
 * @method bool            getIsAnonymous()           True, if the poll is anonymous
21
 * @method string          getType()                  Poll type, currently can be “regular” or “quiz”
22
 * @method bool            getAllowsMultipleAnswers() True, if the poll allows multiple answers
23
 * @method int             getCorrectOptionId()       Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
24
 * @method string          getExplanation()           Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
25
 * @method MessageEntity[] getExplanationEntities()   Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
26
 * @method int             getOpenPeriod()            Optional. Amount of time in seconds the poll will be active after creation
27
 * @method int             getCloseDate()             Optional. Point in time (Unix timestamp) when the poll will be automatically closed
28
 */
29
class Poll extends Entity
30
{
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected function subEntities(): array
36
    {
37
        return [
38
            'options' => [PollOption::class],
39
            'explanation_entities' => [MessageEntity::class],
40
        ];
41
    }
42
43
}
44