Completed
Push — master ( 20255a...21e228 )
by Camilo
06:16
created

SendMediaGroup::getMandatoryFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
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\TelegramResponse;
11
use unreal4u\TelegramAPI\Telegram\Types\Custom\MessageArray;
12
use unreal4u\TelegramAPI\Telegram\Types\InputMedia;
13
14
/**
15
 * Use this method to send photos. On success, the sent Message is returned
16
 *
17
 * Objects defined as-is January 2017
18
 *
19
 * @see https://core.telegram.org/bots/api#sendphoto
20
 */
21
class SendMediaGroup extends TelegramMethods
22
{
23
    /**
24
     * Unique identifier for the target chat or username of the target channel (in the format @channelusername)
25
     * @var string
26
     */
27
    public $chat_id = '';
28
29
    /**
30
     * A JSON-serialized array describing photos and videos to be sent
31
     * @var InputMedia[]
32
     */
33
    public $media = [];
34
35
    /**
36
     * Optional. Sends the message silently. iOS users will not receive a notification, Android users will receive a
37
     * notification with no sound.
38
     * @see https://telegram.org/blog/channels-2-0#silent-messages
39
     * @var bool
40
     */
41
    public $disable_notification = false;
42
43
    /**
44
     * Optional. If the message is a reply, ID of the original message
45
     * @var int
46
     */
47
    public $reply_to_message_id = 0;
48
49
    public function getMandatoryFields(): array
50
    {
51
        return [
52
            'chat_id',
53
            'media',
54
        ];
55
    }
56
    
57
    public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes
58
    {
59
        return new MessageArray($data, $logger);
60
    }
61
}
62