Passed
Pull Request — develop (#1077)
by Marco
02:09
created

InputMediaDocument   A

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
c 1
b 0
f 0
dl 0
loc 11
ccs 0
cts 4
cp 0
rs 10
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 PhpTelegramBot\Core\Entities\InputMedia;
13
14
use PhpTelegramBot\Core\Entities\Entity;
15
16
/**
17
 * Class InputMediaDocument
18
 *
19
 * @link https://core.telegram.org/bots/api#inputmediadocument
20
 *
21
 * <code>
22
 * $data = [
23
 *   'media'      => '123abc',
24
 *   'thumb'      => '456def',
25
 *   'caption'    => '*Document* caption',
26
 *   'parse_mode' => 'markdown',
27
 * ];
28
 * </code>
29
 *
30
 * @method string getType()      Type of the result, must be document
31
 * @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.
32
 * @method string getThumb()     Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
33
 * @method string getCaption()   Optional. Caption of the document to be sent, 0-200 characters
34
 * @method string getParseMode() Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
35
 *
36
 * @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.
37
 * @method $this setThumb(string $thumb)          Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
38
 * @method $this setCaption(string $caption)      Optional. Caption of the document to be sent, 0-200 characters
39
 * @method $this setParseMode(string $parse_mode) Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
40
 */
41
class InputMediaDocument extends Entity implements InputMedia
42
{
43
    /**
44
     * InputMediaDocument constructor
45
     *
46
     * @param array $data
47
     */
48
    public function __construct(array $data = [])
49
    {
50
        $data['type'] = 'document';
51
        parent::__construct($data);
52
    }
53
}
54