Completed
Push — master ( 23095d...54d687 )
by Danilo
02:12
created

InlineQuery   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getQuery() 0 6 2
A getChatID() 0 6 1
A getBotParameter() 0 5 1
1
<?php
2
3
namespace PhpBotFramework\Entities;
4
5
class InlineQuery implements \ArrayAccess {
6
7
    use EntityAccess;
8
9
    public function getQuery() : string {
10
11
        // Get text of the message if any
12
        return isset($this->container['query']) ? $this->container['query'] : null;
13
14
    }
15
16
    public function getChatID() {
17
18
        // Return the chat id
19
        return $this->container['from']['id'];
20
21
    }
22
23
    public function getBotParameter() : array {
24
25
        return ['var' => '_inline_query_id', 'id' => $this->container['id']];
26
27
    }
28
29
}
30