Completed
Push — master ( f47acd...27aef1 )
by Camilo
02:10
created

SetStickerPositionInSet   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A bindToObject() 0 4 1
A getMandatoryFields() 0 7 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Methods;
6
7
use Psr\Log\LoggerInterface;
8
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
9
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
10
use unreal4u\TelegramAPI\InternalFunctionality\TelegramRawData;
11
use unreal4u\TelegramAPI\Telegram\Types\Custom\ResultBoolean;
12
13
/**
14
 * Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success
15
 *
16
 * Objects defined as-is july 2017
17
 *
18
 * @see https://core.telegram.org/bots/api#setstickerpositioninset
19
 */
20
class SetStickerPositionInSet extends TelegramMethods
21
{
22
    /**
23
     * File identifier of the sticker
24
     * @var string
25
     */
26
    public $sticker = '';
27
28
    /**
29
     * New sticker position in the set, zero-based
30
     * @var string
31
     */
32
    public $position = 0;
33
34
    public static function bindToObject(TelegramRawData $data, LoggerInterface $logger): TelegramTypes
35
    {
36
        return new ResultBoolean($data->getResultBoolean(), $logger);
37
    }
38
39
    public function getMandatoryFields(): array
40
    {
41
        return [
42
            'sticker',
43
            'position',
44
        ];
45
    }
46
}
47