PollOption::setVoterCount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\TypeInterface;
7
8
/**
9
 * Class PollOption
10
 * This object contains information about one answer option in a poll.
11
 *
12
 * @package TelegramBot\Api\Types
13
 */
14
class PollOption extends BaseType implements TypeInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     *
19
     * @var array
20
     */
21
    protected static $requiredParams = ['text', 'voter_count'];
22
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @var array
27
     */
28
    protected static $map = [
29
        'text' => true,
30
        'voter_count' => true
31
    ];
32
33
    /**
34
     * Option text, 1-100 characters
35
     *
36
     * @var string
37
     */
38
    protected $text;
39
40
    /**
41
     * Number of users that voted for this option
42
     *
43
     * @var integer
44
     */
45
    protected $voterCount;
46
47
    /**
48
     * @return string
49
     */
50
    public function getText()
51
    {
52
        return $this->text;
53
    }
54
55
    /**
56
     * @param string $text
57
     * @return void
58
     */
59 2
    public function setText($text)
60
    {
61 2
        $this->text = $text;
62 2
    }
63
64
    /**
65
     * @return int
66
     */
67
    public function getVoterCount()
68
    {
69
        return $this->voterCount;
70
    }
71
72
    /**
73
     * @param int $voterCount
74
     * @return void
75 2
     */
76
    public function setVoterCount($voterCount)
77 2
    {
78 2
        $this->voterCount = $voterCount;
79
    }
80
}
81