Passed
Pull Request — master (#56)
by
unknown
07:30
created

Update::getCallbackQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\TypeInterface;
7
use TelegramBot\Api\Types\Inline\ChosenInlineResult;
8
use TelegramBot\Api\Types\Inline\InlineQuery;
9
10
/**
11
 * Class Update
12
 * This object represents an incoming update.
13
 * Only one of the optional parameters can be present in any given update.
14
 *
15
 * @package TelegramBot\Api\Types
16
 */
17
class Update extends BaseType implements TypeInterface
18
{
19
    /**
20
     * {@inheritdoc}
21
     *
22
     * @var array
23
     */
24
    static protected $requiredParams = ['update_id'];
25
26
    /**
27
     * {@inheritdoc}
28
     *
29
     * @var array
30
     */
31
    static protected $map = [
32
        'update_id' => true,
33
        'message' => Message::class,
34
        'inline_query' => InlineQuery::class,
35
        'chosen_inline_result' => ChosenInlineResult::class,
36
        'callback_query' => CallbackQuery::class,
37
    ];
38
39
    /**
40
     * The update‘s unique identifier.
41
     * Update identifiers start from a certain positive number and increase sequentially.
42
     * This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated updates or
43
     * to restore the correct update sequence, should they get out of order.
44
     *
45
     * @var integer
46
     */
47
    protected $updateId;
48
49
    /**
50
     * Optional. New incoming message of any kind — text, photo, sticker, etc.
51
     *
52
     * @var Message
53
     */
54
    protected $message;
55
56
    /**
57
     * Optional. New incoming inline query
58
     *
59
     * @var \TelegramBot\Api\Types\Inline\InlineQuery
60
     */
61
    protected $inlineQuery;
62
63
    /**
64
     * Optional. The result of a inline query that was chosen by a user and sent to their chat partner
65
     *
66
     * @var \TelegramBot\Api\Types\Inline\ChosenInlineResult
67
     */
68
    protected $chosenInlineResult;
69
70
    /**
71
     * Optional. New incoming callback query
72
     *
73
     * @var \TelegramBot\Api\Types\CallbackQuery
74
     */
75
    protected $callbackQuery;
76
77
    /**
78
     * @return int
79
     */
80
    public function getUpdateId()
81
    {
82
        return $this->updateId;
83
    }
84
85
    /**
86
     * @param int $updateId
87
     */
88 3
    public function setUpdateId($updateId)
89
    {
90 3
        $this->updateId = $updateId;
91 3
    }
92
93
    /**
94
     * @return Message
95
     */
96 9
    public function getMessage()
97
    {
98 9
        return $this->message;
99
    }
100
101
    /**
102
     * @param Message $message
103
     */
104 3
    public function setMessage(Message $message)
105
    {
106 3
        $this->message = $message;
107 3
    }
108
109
    /**
110
     * @return InlineQuery
111
     */
112 8
    public function getInlineQuery()
113
    {
114 8
        return $this->inlineQuery;
115
    }
116
117
    /**
118
     * @param InlineQuery $inlineQuery
119
     */
120 1
    public function setInlineQuery($inlineQuery)
121
    {
122 1
        $this->inlineQuery = $inlineQuery;
123 1
    }
124
125
    /**
126
     * @return ChosenInlineResult
127
     */
128
    public function getChosenInlineResult()
129
    {
130
        return $this->chosenInlineResult;
131
    }
132
133
    /**
134
     * @param ChosenInlineResult $chosenInlineResult
135
     */
136
    public function setChosenInlineResult($chosenInlineResult)
137
    {
138
        $this->chosenInlineResult = $chosenInlineResult;
139
    }
140
141
    /**
142
     * @return CallbackQuery
143
     */
144
    public function getCallbackQuery()
145
    {
146
        return $this->callbackQuery;
147
    }
148
149
    /**
150
     * @param CallbackQuery $callbackQuery
151
     */
152
    public function setCallbackQuery($callbackQuery)
153
    {
154
        $this->callbackQuery = $callbackQuery;
155
    }
156
}
157