Completed
Push — master ( 54823d...3e7af9 )
by Armando
04:43 queued 02:31
created

InputMediaVideo::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of the TelegramBot package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\TelegramBot\Entities\InputMedia;
12
13
use Longman\TelegramBot\Entities\Entity;
14
15
/**
16
 * Class InputMediaVideo
17
 *
18
 * @link https://core.telegram.org/bots/api#inputmediavideo
19
 *
20
 * <code>
21
 * $data = [
22
 *   'media'    => '123abc',
23
 *   'caption'  => 'Video caption',
24
 *   'width'    => 800,
25
 *   'heidht'   => 600,
26
 *   'duration' => 42
27
 * ];
28
 * </code>
29
 *
30
 * @method string getType()     Type of the result, must be video
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 getCaption()  Optional. Caption of the video to be sent, 0-200 characters
33
 * @method int    getWidth()    Optional. Video width
34
 * @method int    getHeight()   Optional. Video height
35
 * @method int    getDuration() Optional. Video duration
36
 *
37
 * @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.
38
 * @method $this setCaption(string $caption) Optional. Caption of the video to be sent, 0-200 characters
39
 * @method $this setWidth(int $width)        Optional. Video width
40
 * @method $this setHeight(int $height)      Optional. Video height
41
 * @method $this setDuration(int $duration)  Optional. Video duration
42
 */
43
class InputMediaVideo extends Entity implements InputMedia
44
{
45
    /**
46
     * InputMediaVideo constructor
47
     *
48
     * @param array $data
49
     *
50
     * @throws \Longman\TelegramBot\Exception\TelegramException
51
     */
52
    public function __construct(array $data = [])
53
    {
54
        $data['type'] = 'video';
55
        parent::__construct($data);
56
    }
57
}
58