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

PollOption   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 67
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getText() 0 4 1
A setText() 0 4 1
A getVoterCount() 0 4 1
A setVoterCount() 0 4 1
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 PollOption
11
 * This object contains information about one answer option in a poll.
12
 *
13
 * @package TelegramBot\Api\Types
14
 */
15
class PollOption extends BaseType implements TypeInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     *
20
     * @var array
21
     */
22
    static protected $requiredParams = ['text', 'voter_count'];
23
24
    /**
25
     * {@inheritdoc}
26
     *
27
     * @var array
28
     */
29
    static protected $map = [
30
        'text' => true,
31
        'voter_count' => true
32
    ];
33
34
    /**
35
     * Option text, 1-100 characters
36
     *
37
     * @var string
38
     */
39
    protected $text;
40
41
    /**
42
     * Number of users that voted for this option
43
     *
44
     * @var integer
45
     */
46
    protected $voterCount;
47
48
    /**
49
     * @return string
50
     */
51
    public function getText()
52
    {
53
        return $this->text;
54
    }
55
56
    /**
57
     * @param string $text
58
     */
59
    public function setText($text)
60
    {
61
        $this->text = $text;
62
    }
63
64
    /**
65
     * @return int
66
     */
67
    public function getVoterCount()
68
    {
69
        return $this->voterCount;
70
    }
71
72
    /**
73
     * @param int $voterCount
74
     */
75
    public function setVoterCount($voterCount)
76
    {
77
        $this->voterCount = $voterCount;
78
    }
79
80
81
}
82