InputMediaPhoto   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 12
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace TelegramBot\Entities\InputMedia;
4
5
use TelegramBot\Entities\MessageEntity;
6
use TelegramBot\Entity;
7
8
/**
9
 * Class InputMediaPhoto
10
 *
11
 * @link https://core.telegram.org/bots/api#inputmediaphoto
12
 *
13
 * <code>
14
 * $data = [
15
 *   'media'      => '123abc',
16
 *   'caption'    => '*Photo* caption',
17
 *   'parse_mode' => 'markdown',
18
 * ];
19
 * </code>
20
 *
21
 * @method string          getType()                Type of the result, must be photo
22
 * @method string          getMedia()               File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
23
 * @method string          getCaption()             Optional. Caption of the photo to be sent, 0-200 characters
24
 * @method string          getParseMode()           Optional. Mode for parsing entities in the photo caption
25
 * @method MessageEntity[] getCaptionEntities()     Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
26
 *
27
 * @method $this setMedia(string $media)                        File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
28
 * @method $this setCaption(string $caption)                    Optional. Caption of the photo to be sent, 0-200 characters
29
 * @method $this setParseMode(string $parse_mode)               Optional. Mode for parsing entities in the photo caption
30
 * @method $this setCaptionEntities(array $caption_entities)    Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
31
 */
32
class InputMediaPhoto extends Entity implements InputMedia
33
{
34
35
    /**
36
     * InputMediaPhoto constructor
37
     *
38
     * @param array $data
39
     */
40
    public function __construct(array $data = [])
41
    {
42
        $data['type'] = 'photo';
43
        parent::__construct($data);
44
    }
45
46
}
47