Contact::setFirstName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\TypeInterface;
7
8
/**
9
 * Class Contact
10
 * This object represents a phone contact.
11
 *
12
 * @package TelegramBot\Api\Types
13
 */
14
class Contact extends BaseType implements TypeInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     *
19
     * @var array
20
     */
21
    protected static $requiredParams = ['phone_number', 'first_name'];
22
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @var array
27
     */
28
    protected static $map = [
29
        'phone_number' => true,
30
        'first_name' => true,
31
        'last_name' => true,
32
        'user_id' => true,
33
        'vcard' => true,
34
    ];
35
36
    /**
37
     * Contact's phone number
38
     *
39
     * @var string
40
     */
41
    protected $phoneNumber;
42
43
    /**
44
     * Contact's first name
45
     *
46
     * @var string
47
     */
48
    protected $firstName;
49
50
    /**
51
     * Optional. Contact's last name
52
     *
53
     * @var string|null
54
     */
55
    protected $lastName;
56
57
    /**
58
     * Optional. Contact's user identifier in Telegram
59
     *
60
     * @var int|null
61
     */
62
    protected $userId;
63
64
    /**
65
     * Optional. Additional data about the contact in the form of a vCard
66
     *
67
     * @var string|null
68
     */
69
    protected $vcard;
70
71
    /**
72
     * @return string
73
     */
74 2
    public function getFirstName()
75
    {
76 2
        return $this->firstName;
77
    }
78
79
    /**
80
     * @param string $firstName
81
     * @return void
82 5
     */
83
    public function setFirstName($firstName)
84 5
    {
85 5
        $this->firstName = $firstName;
86
    }
87
88
    /**
89
     * @return null|string
90 2
     */
91
    public function getLastName()
92 2
    {
93
        return $this->lastName;
94
    }
95
96
    /**
97
     * @param string $lastName
98 5
     * @return void
99
     */
100 5
    public function setLastName($lastName)
101 5
    {
102
        $this->lastName = $lastName;
103
    }
104
105
    /**
106 2
     * @return string
107
     */
108 2
    public function getPhoneNumber()
109
    {
110
        return $this->phoneNumber;
111
    }
112
113
    /**
114 5
     * @param string $phoneNumber
115
     * @return void
116 5
     */
117 5
    public function setPhoneNumber($phoneNumber)
118
    {
119
        $this->phoneNumber = $phoneNumber;
120
    }
121
122 2
    /**
123
     * @return int|null
124 2
     */
125
    public function getUserId()
126
    {
127
        return $this->userId;
128
    }
129
130 5
    /**
131
     * @param int $userId
132 5
     * @return void
133 5
     */
134
    public function setUserId($userId)
135
    {
136
        $this->userId = $userId;
137
    }
138 1
139
    /**
140 1
     * @return null|string
141
     */
142
    public function getVCard()
143
    {
144
        return $this->vcard;
145
    }
146 2
147
    /**
148 2
     * @param string $vcard
149 2
     * @return void
150
     */
151
    public function setVCard($vcard)
152
    {
153
        $this->vcard = $vcard;
154
    }
155
}
156