Contact::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: iGusev
5
 * Date: 14/04/16
6
 * Time: 16:01
7
 */
8
9
namespace TelegramBot\Api\Types\Inline\InputMessageContent;
10
11
use TelegramBot\Api\TypeInterface;
12
use TelegramBot\Api\Types\Inline\InputMessageContent;
13
14
/**
15
 * Class Contact
16
 *
17
 * @see https://core.telegram.org/bots/api#inputcontactmessagecontent
18
 * Represents the content of a contact message to be sent as the result of an inline query.
19
 *
20
 * @package TelegramBot\Api\Types\Inline
21
 */
22
class Contact extends InputMessageContent implements TypeInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     *
27
     * @var array
28
     */
29
    protected static $requiredParams = ['phone_number', 'first_name'];
30
31
    /**
32
     * {@inheritdoc}
33
     *
34
     * @var array
35
     */
36
    protected static $map = [
37
        'phone_number' => true,
38
        'first_name' => true,
39
        'last_name' => true,
40
    ];
41
42
    /**
43
     * Contact's phone number
44
     *
45
     * @var string
46
     */
47
    protected $phoneNumber;
48
49
    /**
50
     * Contact's first name
51
     *
52
     * @var string
53
     */
54
    protected $firstName;
55
56
    /**
57
     * Optional. Contact's last name
58
     *
59
     * @var string|null
60
     */
61
    protected $lastName;
62
63
    /**
64
     * Contact constructor.
65
     *
66
     * @param string $phoneNumber
67
     * @param string $firstName
68
     * @param string|null $lastName
69
     */
70
    public function __construct($phoneNumber, $firstName, $lastName = null)
71
    {
72
        $this->phoneNumber = $phoneNumber;
73
        $this->firstName = $firstName;
74
        $this->lastName = $lastName;
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getPhoneNumber()
81
    {
82
        return $this->phoneNumber;
83
    }
84
85
    /**
86
     * @param string $phoneNumber
87
     *
88
     * @return void
89
     */
90
    public function setPhoneNumber($phoneNumber)
91
    {
92
        $this->phoneNumber = $phoneNumber;
93
    }
94
95
    /**
96
     * @return mixed
97
     */
98
    public function getFirstName()
99
    {
100
        return $this->firstName;
101
    }
102
103
    /**
104
     * @param mixed $firstName
105
     *
106
     * @return void
107
     */
108
    public function setFirstName($firstName)
109
    {
110
        $this->firstName = $firstName;
111
    }
112
113
    /**
114
     * @return string|null
115
     */
116
    public function getLastName()
117
    {
118
        return $this->lastName;
119
    }
120
121
    /**
122
     * @param string|null $lastName
123
     *
124
     * @return void
125
     */
126
    public function setLastName($lastName)
127
    {
128
        $this->lastName = $lastName;
129
    }
130
}
131