InputMediaPhoto   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 11
ccs 0
cts 3
cp 0
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the TelegramBot package.
5
 *
6
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Longman\TelegramBot\Entities\InputMedia;
13
14
use Longman\TelegramBot\Entities\Entity;
15
16
/**
17
 * Class InputMediaPhoto
18
 *
19
 * @link https://core.telegram.org/bots/api#inputmediaphoto
20
 *
21
 * <code>
22
 * $data = [
23
 *   'media'      => '123abc',
24
 *   'caption'    => '*Photo* caption',
25
 *   'parse_mode' => 'markdown',
26
 * ];
27
 * </code>
28
 *
29
 * @method string          getType()            Type of the result, must be photo
30
 * @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.
31
 * @method string          getCaption()         Optional. Caption of the photo to be sent, 0-200 characters
32
 * @method string          getParseMode()       Optional. Mode for parsing entities in the photo caption
33
 * @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
34
 *
35
 * @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.
36
 * @method $this setCaption(string $caption)                 Optional. Caption of the photo to be sent, 0-200 characters
37
 * @method $this setParseMode(string $parse_mode)            Optional. Mode for parsing entities in the photo caption
38
 * @method $this setCaptionEntities(array $caption_entities) Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
39
 */
40
class InputMediaPhoto extends Entity implements InputMedia
41
{
42
    /**
43
     * InputMediaPhoto constructor
44
     *
45
     * @param array $data
46
     */
47
    public function __construct(array $data = [])
48
    {
49
        $data['type'] = 'photo';
50
        parent::__construct($data);
51
    }
52
}
53