InlineQuery   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 116
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
dl 0
loc 116
rs 10
c 1
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A setQuery() 0 3 1
A setFrom() 0 3 1
A setId() 0 3 1
A getOffset() 0 3 1
A setOffset() 0 3 1
A getLocation() 0 3 1
A setLocation() 0 3 1
A getId() 0 3 1
A getFrom() 0 3 1
A getQuery() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zanzara\Telegram\Type;
6
7
use Zanzara\Telegram\Type\File\Location;
8
9
/**
10
 * This object represents an incoming inline query. When the user sends an empty query, your bot could return some
11
 * default or trending results.
12
 *
13
 * More on https://core.telegram.org/bots/api#inlinequery
14
 */
15
class InlineQuery
16
{
17
18
    /**
19
     * Unique identifier for this query
20
     *
21
     * @var string
22
     */
23
    private $id;
24
25
    /**
26
     * Sender
27
     *
28
     * @var User
29
     */
30
    private $from;
31
32
    /**
33
     * Optional. Sender location, only for bots that request user location
34
     *
35
     * @var Location|null
36
     */
37
    private $location;
38
39
    /**
40
     * Text of the query (up to 256 characters)
41
     *
42
     * @var string
43
     */
44
    private $query;
45
46
    /**
47
     * Offset of the results to be returned, can be controlled by the bot
48
     *
49
     * @var string
50
     */
51
    private $offset;
52
53
    /**
54
     * @return string
55
     */
56
    public function getId(): string
57
    {
58
        return $this->id;
59
    }
60
61
    /**
62
     * @param string $id
63
     */
64
    public function setId(string $id): void
65
    {
66
        $this->id = $id;
67
    }
68
69
    /**
70
     * @return User
71
     */
72
    public function getFrom(): User
73
    {
74
        return $this->from;
75
    }
76
77
    /**
78
     * @param User $from
79
     */
80
    public function setFrom(User $from): void
81
    {
82
        $this->from = $from;
83
    }
84
85
    /**
86
     * @return Location|null
87
     */
88
    public function getLocation(): ?Location
89
    {
90
        return $this->location;
91
    }
92
93
    /**
94
     * @param Location|null $location
95
     */
96
    public function setLocation(?Location $location): void
97
    {
98
        $this->location = $location;
99
    }
100
101
    /**
102
     * @return string
103
     */
104
    public function getQuery(): string
105
    {
106
        return $this->query;
107
    }
108
109
    /**
110
     * @param string $query
111
     */
112
    public function setQuery(string $query): void
113
    {
114
        $this->query = $query;
115
    }
116
117
    /**
118
     * @return string
119
     */
120
    public function getOffset(): string
121
    {
122
        return $this->offset;
123
    }
124
125
    /**
126
     * @param string $offset
127
     */
128
    public function setOffset(string $offset): void
129
    {
130
        $this->offset = $offset;
131
    }
132
133
}