Passed
Pull Request — master (#408)
by Alexander
01:43
created

Invoice   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 141
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrency() 0 3 1
A setDescription() 0 3 1
A getTotalAmount() 0 3 1
A getStartParameter() 0 3 1
A setTitle() 0 3 1
A setTotalAmount() 0 3 1
A setStartParameter() 0 3 1
A getDescription() 0 3 1
A setCurrency() 0 3 1
A getTitle() 0 3 1
1
<?php
2
3
namespace TelegramBot\Api\Types\Payments;
4
5
use TelegramBot\Api\BaseType;
6
7
/**
8
 * Class Invoice
9
 * This object contains basic information about an invoice.
10
 *
11
 * @package TelegramBot\Api\Types\Payments
12
 */
13
class Invoice extends BaseType
14
{
15
    /**
16
     * @var array
17
     */
18
    static protected $requiredParams = ['title', 'description', 'start_parameter', 'currency', 'total_amount'];
19
20
    /**
21
     * @var array
22
     */
23
    static protected $map = [
24
        'title' => true,
25
        'description' => true,
26
        'start_parameter' => true,
27
        'currency' => true,
28
        'total_amount' => true,
29
    ];
30
31
    /**
32
     * Product name
33
     *
34
     * @var string
35
     */
36
    protected $title;
37
38
    /**
39
     * Product description
40
     *
41
     * @var string
42
     */
43
    protected $description;
44
45
    /**
46
     * Unique bot deep-linking parameter that can be used to generate this invoice
47
     *
48
     * @var string
49
     */
50
    protected $startParameter;
51
52
    /**
53
     * Three-letter ISO 4217 currency code
54
     *
55
     * @var string
56
     */
57
    protected $currency;
58
59
    /**
60
     * Total price in the smallest units of the currency
61
     *
62
     * @var integer
63
     */
64
    protected $totalAmount;
65
66
    /**
67
     * @author MY
68
     * @return string
69
     */
70
    public function getTitle()
71
    {
72
        return $this->title;
73
    }
74
75
    /**
76
     * @author MY
77
     * @param string $title
78
     */
79
    public function setTitle($title)
80
    {
81
        $this->title = $title;
82
    }
83
84
    /**
85
     * @author MY
86
     * @return string
87
     */
88
    public function getDescription()
89
    {
90
        return $this->description;
91
    }
92
93
    /**
94
     * @author MY
95
     * @param string $description
96
     */
97
    public function setDescription($description)
98
    {
99
        $this->description = $description;
100
    }
101
102
    /**
103
     * @author MY
104
     * @return string
105
     */
106
    public function getStartParameter()
107
    {
108
        return $this->startParameter;
109
    }
110
111
    /**
112
     * @author MY
113
     * @param string $startParameter
114
     */
115
    public function setStartParameter($startParameter)
116
    {
117
        $this->startParameter = $startParameter;
118
    }
119
120
    /**
121
     * @author MY
122
     * @return string
123
     */
124
    public function getCurrency()
125
    {
126
        return $this->currency;
127
    }
128
129
    /**
130
     * @author MY
131
     * @param string $currency
132
     */
133
    public function setCurrency($currency)
134
    {
135
        $this->currency = $currency;
136
    }
137
138
    /**
139
     * @author MY
140
     * @return int
141
     */
142
    public function getTotalAmount()
143
    {
144
        return $this->totalAmount;
145
    }
146
147
    /**
148
     * @author MY
149
     * @param int $totalAmount
150
     */
151
    public function setTotalAmount($totalAmount)
152
    {
153
        $this->totalAmount = $totalAmount;
154
    }
155
}
156