Completed
Pull Request — master (#53)
by Rick
02:25
created

SendPhoto::getMandatoryFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 2
cts 2
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Methods;
6
7
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
8
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
9
10
/**
11
 * Use this method to send photos. On success, the sent Message is returned
12
 *
13
 * Objects defined as-is January 2017
14
 *
15
 * @see https://core.telegram.org/bots/api#sendphoto
16
 */
17
class SendPhoto extends TelegramMethods
18
{
19
    /**
20
     * Unique identifier for the target chat or username of the target channel (in the format @channelusername)
21
     * @var string
22
     */
23
    public $chat_id = '';
24
25
    /**
26
     * Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass
27
     * an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using the InputFile
28
     * class.
29
     * @see InputFile
30
     * @var string|InputFile
31
     */
32
    public $photo = '';
33
34
    /**
35
     * Optional. Photo caption (may also be used when resending photos by file_id)
36
     * @var string
37
     */
38
    public $caption = '';
39
40
    /**
41
     * Optional. Sends the message silently. iOS users will not receive a notification, Android users will receive a
42
     * notification with no sound.
43
     * @see https://telegram.org/blog/channels-2-0#silent-messages
44
     * @var bool
45
     */
46
    public $disable_notification = false;
47
48
    /**
49
     * Optional. If the message is a reply, ID of the original message
50
     * @var int
51
     */
52
    public $reply_to_message_id = 0;
53
54
    /**
55
     * Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to
56
     * hide keyboard or to force a reply from the user
57
     * @var null
58
     */
59
    public $reply_markup;
60
61 1
    public function getMandatoryFields(): array
62
    {
63
        return [
64 1
            'chat_id',
65
            'photo',
66
        ];
67
    }
68
}
69