AbstractInlineQueryResult   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 141
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 11
eloc 20
c 1
b 0
f 1
dl 0
loc 141
ccs 0
cts 47
cp 0
rs 10

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A __construct() 0 6 1
A getReplyMarkup() 0 3 1
A getTitle() 0 3 1
A getInputMessageContent() 0 3 1
A setType() 0 3 1
A setReplyMarkup() 0 3 1
A setInputMessageContent() 0 3 1
A getId() 0 3 1
A setTitle() 0 3 1
A setId() 0 3 1
1
<?php
2
3
namespace TelegramBot\Api\Types\Inline\QueryResult;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
7
use TelegramBot\Api\Types\Inline\InputMessageContent;
8
9
/**
10
 * Class AbstractInlineQueryResult
11
 * Abstract class for representing one result of an inline query
12
 *
13
 * @package TelegramBot\Api\Types
14
 */
15
class AbstractInlineQueryResult extends BaseType
16
{
17
    /**
18
     * Type of the result, must be one of: article, photo, gif, mpeg4_gif, video
19
     *
20
     * @var string
21
     */
22
    protected $type;
23
24
    /**
25
     * Unique identifier for this result, 1-64 bytes
26
     *
27
     * @var string
28
     */
29
    protected $id;
30
31
    /**
32
     * Title for the result
33
     *
34
     * @var string|null
35
     */
36
    protected $title;
37
38
    /**
39
     * Content of the message to be sent instead of the file
40
     *
41
     * @var InputMessageContent|null
42
     */
43
    protected $inputMessageContent;
44
45
    /**
46
     * Optional. Inline keyboard attached to the message
47
     *
48
     * @var InlineKeyboardMarkup|null
49
     */
50
    protected $replyMarkup;
51
52
    /**
53
     * AbstractInlineQueryResult constructor.
54
     *
55
     * @param string $id
56
     * @param string|null $title
57
     * @param InputMessageContent|null $inputMessageContent
58
     * @param InlineKeyboardMarkup|null $replyMarkup
59
     */
60
    public function __construct($id, $title = null, $inputMessageContent = null, $replyMarkup = null)
61
    {
62
        $this->id = $id;
63
        $this->title = $title;
64
        $this->inputMessageContent = $inputMessageContent;
65
        $this->replyMarkup = $replyMarkup;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getType()
72
    {
73
        return $this->type;
74
    }
75
76
    /**
77
     * @param string $type
78
     *
79
     * @return void
80
     */
81
    public function setType($type)
82
    {
83
        $this->type = $type;
84
    }
85
86
    /**
87
     * @return string
88
     */
89
    public function getId()
90
    {
91
        return $this->id;
92
    }
93
94
    /**
95
     * @param string $id
96
     *
97
     * @return void
98
     */
99
    public function setId($id)
100
    {
101
        $this->id = $id;
102
    }
103
104
    /**
105
     * @return string|null
106
     */
107
    public function getTitle()
108
    {
109
        return $this->title;
110
    }
111
112
    /**
113
     * @param string|null $title
114
     *
115
     * @return void
116
     */
117
    public function setTitle($title)
118
    {
119
        $this->title = $title;
120
    }
121
122
    /**
123
     * @return InputMessageContent|null
124
     */
125
    public function getInputMessageContent()
126
    {
127
        return $this->inputMessageContent;
128
    }
129
130
    /**
131
     * @param InputMessageContent|null $inputMessageContent
132
     *
133
     * @return void
134
     */
135
    public function setInputMessageContent($inputMessageContent)
136
    {
137
        $this->inputMessageContent = $inputMessageContent;
138
    }
139
140
    /**
141
     * @return InlineKeyboardMarkup|null
142
     */
143
    public function getReplyMarkup()
144
    {
145
        return $this->replyMarkup;
146
    }
147
148
    /**
149
     * @param InlineKeyboardMarkup|null $replyMarkup
150
     *
151
     * @return void
152
     */
153
    public function setReplyMarkup($replyMarkup)
154
    {
155
        $this->replyMarkup = $replyMarkup;
156
    }
157
}
158