Passed
Push — master ( 58897c...6910c8 )
by Alexander
06:09 queued 12s
created

Contact::getPhoneNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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