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

PreCheckoutQuery   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 195
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 14
lcom 0
cbo 1
dl 195
loc 195
ccs 0
cts 56
cp 0
rs 10
c 0
b 0
f 0

14 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 4 4 1
A setId() 4 4 1
A getFrom() 4 4 1
A setFrom() 4 4 1
A getCurrency() 4 4 1
A setCurrency() 4 4 1
A getTotalAmount() 4 4 1
A setTotalAmount() 4 4 1
A getInvoicePayload() 4 4 1
A setInvoicePayload() 4 4 1
A getShippingOptionId() 4 4 1
A setShippingOptionId() 4 4 1
A getOrderInfo() 4 4 1
A setOrderInfo() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace TelegramBot\Api\Types\Payments\Query;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\Types\Payments\ArrayOfLabeledPrice;
7
use TelegramBot\Api\Types\Payments\OrderInfo;
8
use TelegramBot\Api\Types\Payments\ShippingAddress;
9
use TelegramBot\Api\Types\User;
10
11
/**
12
 * Class PreCheckoutQuery
13
 * This object contains information about an incoming pre-checkout query.
14
 *
15
 * @package TelegramBot\Api\Types\Payments\Query
16
 */
17 View Code Duplication
class PreCheckoutQuery extends BaseType
18
{
19
    /**
20
     * @var array
21
     */
22
    static protected $requiredParams = ['id', 'from', 'currency', 'total_amount', 'invoice_payload'];
23
24
    /**
25
     * @var array
26
     */
27
    static protected $map = [
28
        'id' => true,
29
        'from' => User::class,
30
        'currency' => true,
31
        'total_amount' => true,
32
        'invoice_payload' => true,
33
        'shipping_option_id' => true,
34
        'order_info' => OrderInfo::class
35
    ];
36
37
    /**
38
     * Unique query identifier
39
     *
40
     * @var string
41
     */
42
    protected $id;
43
44
    /**
45
     * User who sent the query
46
     *
47
     * @var User
48
     */
49
    protected $from;
50
51
    /**
52
     * Three-letter ISO 4217 currency code
53
     *
54
     * @var string
55
     */
56
    protected $currency;
57
58
    /**
59
     * Total price in the smallest units of the currency
60
     *
61
     * @var integer
62
     */
63
    protected $totalAmount;
64
65
    /**
66
     * Bot specified invoice payload
67
     *
68
     * @var string
69
     */
70
    protected $invoicePayload;
71
72
    /**
73
     * Optional. Identifier of the shipping option chosen by the user
74
     *
75
     * @var string
76
     */
77
    protected $shippingOptionId;
78
79
    /**
80
     * Optional. Order info provided by the user
81
     *
82
     * @var OrderInfo
83
     */
84
    protected $orderInfo;
85
86
    /**
87
     * @author MY
88
     * @return string
89
     */
90
    public function getId()
91
    {
92
        return $this->id;
93
    }
94
95
    /**
96
     * @author MY
97
     * @param string $id
98
     */
99
    public function setId($id)
100
    {
101
        $this->id = $id;
102
    }
103
104
    /**
105
     * @author MY
106
     * @return User
107
     */
108
    public function getFrom()
109
    {
110
        return $this->from;
111
    }
112
113
    /**
114
     * @author MY
115
     * @param User $from
116
     */
117
    public function setFrom($from)
118
    {
119
        $this->from = $from;
120
    }
121
122
    /**
123
     * @author MY
124
     * @return string
125
     */
126
    public function getCurrency()
127
    {
128
        return $this->currency;
129
    }
130
131
    /**
132
     * @author MY
133
     * @param string $currency
134
     */
135
    public function setCurrency($currency)
136
    {
137
        $this->currency = $currency;
138
    }
139
140
    /**
141
     * @author MY
142
     * @return int
143
     */
144
    public function getTotalAmount()
145
    {
146
        return $this->totalAmount;
147
    }
148
149
    /**
150
     * @author MY
151
     * @param int $totalAmount
152
     */
153
    public function setTotalAmount($totalAmount)
154
    {
155
        $this->totalAmount = $totalAmount;
156
    }
157
158
    /**
159
     * @author MY
160
     * @return mixed
161
     */
162
    public function getInvoicePayload()
163
    {
164
        return $this->invoicePayload;
165
    }
166
167
    /**
168
     * @author MY
169
     * @param mixed $invoicePayload
170
     */
171
    public function setInvoicePayload($invoicePayload)
172
    {
173
        $this->invoicePayload = $invoicePayload;
174
    }
175
176
    /**
177
     * @author MY
178
     * @return string
179
     */
180
    public function getShippingOptionId()
181
    {
182
        return $this->shippingOptionId;
183
    }
184
185
    /**
186
     * @author MY
187
     * @param string $shippingOptionId
188
     */
189
    public function setShippingOptionId($shippingOptionId)
190
    {
191
        $this->shippingOptionId = $shippingOptionId;
192
    }
193
194
    /**
195
     * @author MY
196
     * @return OrderInfo
197
     */
198
    public function getOrderInfo()
199
    {
200
        return $this->orderInfo;
201
    }
202
203
    /**
204
     * @author MY
205
     * @param OrderInfo $orderInfo
206
     */
207
    public function setOrderInfo($orderInfo)
208
    {
209
        $this->orderInfo = $orderInfo;
210
    }
211
}
212