Completed
Push — master ( c5a554...c7f2a3 )
by Gusev
03:01
created

InlineQuery::setLocation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace TelegramBot\Api\Types\Inline;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\Types\Location;
7
use TelegramBot\Api\Types\User;
8
9
/**
10
 * Class InlineQuery
11
 * This object represents an incoming inline query.
12
 * When the user sends an empty query, your bot could return some default or trending results.
13
 *
14
 * @package TelegramBot\Api\Types
15
 */
16
class InlineQuery extends BaseType
17
{
18
    /**
19
     * {@inheritdoc}
20
     *
21
     * @var array
22
     */
23
    static protected $requiredParams = ['id', 'from', 'query', 'offset'];
24
25
    /**
26
     * {@inheritdoc}
27
     *
28
     * @var array
29
     */
30
    static protected $map = [
31
        'id' => true,
32
        'from' => User::class,
33
        'location' => Location::class,
34
        'query' => true,
35
        'offset' => true,
36
    ];
37
38
    /**
39
     * Unique identifier for this query
40
     *
41
     * @var string
42
     */
43
    protected $id;
44
45
    /**
46
     * Sender
47
     *
48
     * @var User
49
     */
50
    protected $from;
51
52
53
    /**
54
     * Optional. Sender location, only for bots that request user location
55
     *
56
     * @var Location
57
     */
58
    protected $location;
59
60
    /**
61
     * Text of the query
62
     *
63
     * @var string
64
     */
65
    protected $query;
66
67
    /**
68
     * Offset of the results to be returned, can be controlled by the bot
69
     *
70
     * @var string
71
     */
72
    protected $offset;
73
74
    /**
75
     * @return string
76
     */
77 3
    public function getId()
78
    {
79 3
        return $this->id;
80
    }
81
82
    /**
83
     * @param string $id
84
     */
85 5
    public function setId($id)
86
    {
87 5
        $this->id = $id;
88 5
    }
89
90
    /**
91
     * @return User
92
     */
93 3
    public function getFrom()
94
    {
95 3
        return $this->from;
96
    }
97
98
    /**
99
     * @param User $from
100
     */
101 5
    public function setFrom(User $from)
102
    {
103 5
        $this->from = $from;
104 5
    }
105
106
    /**
107
     * @return Location
108
     */
109
    public function getLocation()
110
    {
111
        return $this->location;
112
    }
113
114
    /**
115
     * @param Location $location
116
     */
117
    public function setLocation($location)
118
    {
119
        $this->location = $location;
120
    }
121
122
    /**
123
     * @return string
124
     */
125 1
    public function getQuery()
126
    {
127 1
        return $this->query;
128
    }
129
130
    /**
131
     * @param string $query
132
     */
133 5
    public function setQuery($query)
134
    {
135 5
        $this->query = $query;
136 5
    }
137
138
    /**
139
     * @return string
140
     */
141 3
    public function getOffset()
142
    {
143 3
        return $this->offset;
144
    }
145
146
    /**
147
     * @param string $offset
148
     */
149 5
    public function setOffset($offset)
150
    {
151 5
        $this->offset = $offset;
152 5
    }
153
}
154