Completed
Push — master ( 989005...ce143f )
by Camilo
04:43
created

ShippingOption   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 30
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapSubObjects() 0 9 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
 * This object represents one shipping option
11
 *
12
 * Objects defined as-is may 2017
13
 *
14
 * @see https://core.telegram.org/bots/api#shippingoption
15
 */
16
class ShippingOption extends TelegramTypes
17
{
18
    /**
19
     * Shipping option identifier
20
     * @var string
21
     */
22
    public $id = '';
23
24
    /**
25
     * Option title
26
     * @var string
27
     */
28
    public $title = '';
29
30
    /**
31
     * List of price portions
32
     * @var LabeledPrice[]
33
     */
34
    public $prices = [];
35
36
    protected function mapSubObjects(string $key, array $data): TelegramTypes
37
    {
38
        switch ($key) {
39
            case 'prices':
40
                return new LabeledPrice($data, $this->logger);
41
        }
42
43
        return parent::mapSubObjects($key, $data);
44
    }
45
}
46