Completed
Push — master ( 6fd684...0d01f6 )
by Gusev
03:07
created

Contact::getThumbUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: iGusev
5
 * Date: 14/04/16
6
 * Time: 03:58
7
 */
8
9
namespace TelegramBot\Api\Types\Inline\QueryResult;
10
11
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
12
use TelegramBot\Api\Types\Inline\InputMessageContent;
13
14 View Code Duplication
class Contact extends AbstractInlineQueryResult
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /**
17
     * {@inheritdoc}
18
     *
19
     * @var array
20
     */
21
    static protected $requiredParams = ['type', 'id', 'phone_number', 'first_name'];
22
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @var array
27
     */
28
    static protected $map = [
29
        'type' => true,
30
        'id' => true,
31
        'phone_number' => true,
32
        'first_name' => true,
33
        'last_name' => true,
34
        'reply_markup' => InlineKeyboardMarkup::class,
35
        'input_message_content' => InputMessageContent::class,
36
        'thumb_url' => true,
37
        'thumb_width' => true,
38
        'thumb_height' => true,
39
    ];
40
41
    /**
42
     * {@inheritdoc}
43
     *
44
     * @var string
45
     */
46
    protected $type = 'contact';
47
48
    /**
49
     * Contact's phone number
50
     *
51
     * @var string
52
     */
53
    protected $phoneNumber;
54
55
    /**
56
     * Contact's first name
57
     *
58
     * @var string
59
     */
60
    protected $firstName;
61
62
    /**
63
     * Optional. Contact's last name
64
     *
65
     * @var string
66
     */
67
    protected $lastName;
68
69
    /**
70
     * Optional. Url of the thumbnail for the result
71
     *
72
     * @var string
73
     */
74
    protected $thumbUrl;
75
76
    /**
77
     * Optional. Thumbnail width
78
     *
79
     * @var int
80
     */
81
    protected $thumbWidth;
82
83
    /**
84
     * Optional. Thumbnail height
85
     *
86
     * @var int
87
     */
88
    protected $thumbHeight;
89
90
    /**
91
     * Contact constructor.
92
     * @param string $id
93
     * @param string $phoneNumber
94
     * @param string $firstName
95
     * @param string $lastName
96
     * @param string $thumbUrl
97
     * @param int $thumbWidth
98
     * @param int $thumbHeight
99
     * @param InputMessageContent|null $inputMessageContent
100
     * @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
101
     */
102
    public function __construct(
103
        $id,
104
        $phoneNumber,
105
        $firstName,
106
        $lastName = null,
107
        $thumbUrl = null,
108
        $thumbWidth = null,
109
        $thumbHeight = null,
110
        $inputMessageContent = null,
111
        $inlineKeyboardMarkup = null
112
    )
113
    {
114
        parent::__construct($id, null, $inputMessageContent, $inlineKeyboardMarkup);
115
116
        $this->phoneNumber = $phoneNumber;
117
        $this->firstName = $firstName;
118
        $this->lastName = $lastName;
119
        $this->thumbUrl = $thumbUrl;
120
        $this->thumbWidth = $thumbWidth;
121
        $this->thumbHeight = $thumbHeight;
122
    }
123
124
125
    /**
126
     * @return string
127
     */
128
    public function getPhoneNumber()
129
    {
130
        return $this->phoneNumber;
131
    }
132
133
    /**
134
     * @param string $phoneNumber
135
     */
136
    public function setPhoneNumber($phoneNumber)
137
    {
138
        $this->phoneNumber = $phoneNumber;
139
    }
140
141
    /**
142
     * @return string
143
     */
144
    public function getFirstName()
145
    {
146
        return $this->firstName;
147
    }
148
149
    /**
150
     * @param string $firstName
151
     */
152
    public function setFirstName($firstName)
153
    {
154
        $this->firstName = $firstName;
155
    }
156
157
    /**
158
     * @return string
159
     */
160
    public function getLastName()
161
    {
162
        return $this->lastName;
163
    }
164
165
    /**
166
     * @param string $lastName
167
     */
168
    public function setLastName($lastName)
169
    {
170
        $this->lastName = $lastName;
171
    }
172
173
    /**
174
     * @return string
175
     */
176
    public function getThumbUrl()
177
    {
178
        return $this->thumbUrl;
179
    }
180
181
    /**
182
     * @param string $thumbUrl
183
     */
184
    public function setThumbUrl($thumbUrl)
185
    {
186
        $this->thumbUrl = $thumbUrl;
187
    }
188
189
    /**
190
     * @return int
191
     */
192
    public function getThumbWidth()
193
    {
194
        return $this->thumbWidth;
195
    }
196
197
    /**
198
     * @param int $thumbWidth
199
     */
200
    public function setThumbWidth($thumbWidth)
201
    {
202
        $this->thumbWidth = $thumbWidth;
203
    }
204
205
    /**
206
     * @return int
207
     */
208
    public function getThumbHeight()
209
    {
210
        return $this->thumbHeight;
211
    }
212
213
    /**
214
     * @param int $thumbHeight
215
     */
216
    public function setThumbHeight($thumbHeight)
217
    {
218
        $this->thumbHeight = $thumbHeight;
219
    }
220
}
221