Passed
Pull Request — master (#227)
by
unknown
02:17
created

Poll::setId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\InvalidArgumentException;
7
use TelegramBot\Api\TypeInterface;
8
9
/**
10
 * Class Poll
11
 * This object contains information about a poll.
12
 *
13
 * @package TelegramBot\Api\Types
14
 */
15
class Poll extends BaseType implements TypeInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     *
20
     * @var array
21
     */
22
    static protected $requiredParams = ['id', 'question', 'options', 'is_closed'];
23
24
    /**
25
     * {@inheritdoc}
26
     *
27
     * @var array
28
     */
29
    static protected $map = [
30
        'id' => true,
31
        'question' => true,
32
        'options' => ArrayOfPollOption::class,
33
        'is_closed' => true
34
    ];
35
36
    /**
37
     * Unique poll identifier
38
     *
39
     * @var string
40
     */
41
    protected $id;
42
43
    /**
44
     * Poll question, 1-255 characters
45
     *
46
     * @var string
47
     */
48
    protected $question;
49
50
    /**
51
     * List of poll options
52
     * Array of \TelegramBot\Api\Types\PollOption
53
     *
54
     * @var array
55
     */
56
    protected $options;
57
58
    /**
59
     * True, if the poll is closed
60
     *
61
     * @var boolean
62
     */
63
    protected $isClosed;
64
65
    /**
66
     * @return string
67
     */
68
    public function getId()
69
    {
70
        return $this->id;
71
    }
72
73
    /**
74
     * @param string $id
75
     */
76
    public function setId($id)
77
    {
78
        $this->id = $id;
79
    }
80
81
    /**
82
     * @return string
83
     */
84
    public function getQuestion()
85
    {
86
        return $this->question;
87
    }
88
89
    /**
90
     * @param string $question
91
     */
92
    public function setQuestion($question)
93
    {
94
        $this->question = $question;
95
    }
96
97
    /**
98
     * @return array
99
     */
100
    public function getOptions()
101
    {
102
        return $this->options;
103
    }
104
105
    /**
106
     * @param array $options
107
     */
108
    public function setOptions($options)
109
    {
110
        $this->options = $options;
111
    }
112
113
    /**
114
     * @return bool
115
     */
116
    public function isClosed()
117
    {
118
        return $this->isClosed;
119
    }
120
121
    /**
122
     * @param bool $isClosed
123
     */
124
    public function setIsClosed($isClosed)
125
    {
126
        $this->isClosed = $isClosed;
127
    }
128
}
129