Completed
Push — master ( 1f7e67...a1b9db )
by
unknown
07:31
created

Update   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 192
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 37.14%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 14
lcom 0
cbo 1
dl 0
loc 192
ccs 13
cts 35
cp 0.3714
rs 10
c 1
b 0
f 1

14 Methods

Rating   Name   Duplication   Size   Complexity  
A getUpdateId() 0 4 1
A setUpdateId() 0 4 1
A getMessage() 0 4 1
A setMessage() 0 4 1
A getInlineQuery() 0 4 1
A setInlineQuery() 0 4 1
A getChosenInlineResult() 0 4 1
A setChosenInlineResult() 0 4 1
A getCallbackQuery() 0 4 1
A setCallbackQuery() 0 4 1
A getShippingQuery() 0 4 1
A setShippingQuery() 0 4 1
A getPreCheckoutQuery() 0 4 1
A setPreCheckoutQuery() 0 4 1
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
use TelegramBot\Api\Types\Payments\Query\PreCheckoutQuery;
10
use TelegramBot\Api\Types\Payments\Query\ShippingQuery;
11
12
/**
13
 * Class Update
14
 * This object represents an incoming update.
15
 * Only one of the optional parameters can be present in any given update.
16
 *
17
 * @package TelegramBot\Api\Types
18
 */
19
class Update extends BaseType implements TypeInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     *
24
     * @var array
25
     */
26
    static protected $requiredParams = ['update_id'];
27
28
    /**
29
     * {@inheritdoc}
30
     *
31
     * @var array
32
     */
33
    static protected $map = [
34
        'update_id' => true,
35
        'message' => Message::class,
36
        'inline_query' => InlineQuery::class,
37
        'chosen_inline_result' => ChosenInlineResult::class,
38
        'callback_query' => CallbackQuery::class,
39
        'shipping_query' => ShippingQuery::class,
40
        'pre_checkout_query' => PreCheckoutQuery::class,
41
    ];
42
43
    /**
44
     * The update‘s unique identifier.
45
     * Update identifiers start from a certain positive number and increase sequentially.
46
     * This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated updates or
47
     * to restore the correct update sequence, should they get out of order.
48
     *
49
     * @var integer
50
     */
51
    protected $updateId;
52
53
    /**
54
     * Optional. New incoming message of any kind — text, photo, sticker, etc.
55
     *
56
     * @var Message
57
     */
58
    protected $message;
59
60
    /**
61
     * Optional. New incoming inline query
62
     *
63
     * @var \TelegramBot\Api\Types\Inline\InlineQuery
64
     */
65
    protected $inlineQuery;
66
67
    /**
68
     * Optional. The result of a inline query that was chosen by a user and sent to their chat partner
69
     *
70
     * @var \TelegramBot\Api\Types\Inline\ChosenInlineResult
71
     */
72
    protected $chosenInlineResult;
73
74
    /**
75
     * Optional. New incoming callback query
76
     *
77
     * @var \TelegramBot\Api\Types\CallbackQuery
78
     */
79
    protected $callbackQuery;
80
81
    /**
82
     * Optional. New incoming shipping query. Only for invoices with flexible price
83
     *
84
     * @var ShippingQuery
85
     */
86
    protected $shippingQuery;
87
88
    /**
89
     * Optional. New incoming pre-checkout query. Contains full information about checkout
90
     *
91
     * @var PreCheckoutQuery
92
     */
93
    protected $preCheckoutQuery;
94
95
    /**
96
     * @return int
97
     */
98
    public function getUpdateId()
99
    {
100
        return $this->updateId;
101
    }
102
103
    /**
104
     * @param int $updateId
105
     */
106 3
    public function setUpdateId($updateId)
107
    {
108 3
        $this->updateId = $updateId;
109 3
    }
110
111
    /**
112
     * @return Message
113
     */
114 9
    public function getMessage()
115
    {
116 9
        return $this->message;
117
    }
118
119
    /**
120
     * @param Message $message
121
     */
122 3
    public function setMessage(Message $message)
123
    {
124 3
        $this->message = $message;
125 3
    }
126
127
    /**
128
     * @return InlineQuery
129
     */
130 8
    public function getInlineQuery()
131
    {
132 8
        return $this->inlineQuery;
133
    }
134
135
    /**
136
     * @param InlineQuery $inlineQuery
137
     */
138 1
    public function setInlineQuery($inlineQuery)
139
    {
140 1
        $this->inlineQuery = $inlineQuery;
141 1
    }
142
143
    /**
144
     * @return ChosenInlineResult
145
     */
146
    public function getChosenInlineResult()
147
    {
148
        return $this->chosenInlineResult;
149
    }
150
151
    /**
152
     * @param ChosenInlineResult $chosenInlineResult
153
     */
154
    public function setChosenInlineResult($chosenInlineResult)
155
    {
156
        $this->chosenInlineResult = $chosenInlineResult;
157
    }
158
159
    /**
160
     * @return CallbackQuery
161
     */
162
    public function getCallbackQuery()
163
    {
164
        return $this->callbackQuery;
165
    }
166
167
    /**
168
     * @param CallbackQuery $callbackQuery
169
     */
170
    public function setCallbackQuery($callbackQuery)
171
    {
172
        $this->callbackQuery = $callbackQuery;
173
    }
174
175
    /**
176
     * @author MY
177
     * @return ShippingQuery
178
     */
179
    public function getShippingQuery()
180
    {
181
        return $this->shippingQuery;
182
    }
183
184
    /**
185
     * @author MY
186
     * @param ShippingQuery $shippingQuery
187
     */
188
    public function setShippingQuery($shippingQuery)
189
    {
190
        $this->shippingQuery = $shippingQuery;
191
    }
192
193
    /**
194
     * @author MY
195
     * @return PreCheckoutQuery
196
     */
197
    public function getPreCheckoutQuery()
198
    {
199
        return $this->preCheckoutQuery;
200
    }
201
202
    /**
203
     * @author MY
204
     * @param PreCheckoutQuery $preCheckoutQuery
205
     */
206
    public function setPreCheckoutQuery($preCheckoutQuery)
207
    {
208
        $this->preCheckoutQuery = $preCheckoutQuery;
209
    }
210
}
211