Completed
Push — master ( 182148...96a7e0 )
by Camilo
08:46
created

ChatLocation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapSubObjects() 0 8 2
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Types;
6
7
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
8
9
/**
10
 * Represents a location to which a chat is connected
11
 *
12
 * Objects defined as-is november 2020, Bot API v5.0
13
 *
14
 * @see https://core.telegram.org/bots/api#chat
15
 */
16
class ChatLocation extends TelegramTypes
17
{
18
    /**
19
     * The location to which the supergroup is connected. Can't be a live location.
20
     * @var Location
21
     */
22
    public $location;
23
24
    /**
25
     * Location address; 1-64 characters, as defined by the chat owner
26
     * @var string
27
     */
28
    public $address = '';
29
30
    public function mapSubObjects(string $key, array $data): TelegramTypes
31
    {
32
        switch ($key) {
33
            case 'location':
34
                return new Location($data, $this->logger);
35
        }
36
        return parent::mapSubObjects($key, $data);
37
    }
38
}
39