Completed
Push — draft ( 93e9ee...93a74b )
by Nikolay
02:20
created

InlineQueryResultCachedVideoType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 0
loc 67
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Type\InlineQueryResult;
6
7
use Greenplugin\TelegramBot\Method\Interfaces\HasParseModeVariableInterface;
8
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
9
use Greenplugin\TelegramBot\Type\InputMessageContent\InputMessageContentType;
10
11
/**
12
 * Class InlineQueryResultCachedVideoType.
13
 *
14
 * @see https://core.telegram.org/bots/api#inlinequeryresultcachedvideo
15
 */
16
class InlineQueryResultCachedVideoType extends InlineQueryResultType implements HasParseModeVariableInterface
17
{
18
    use FillFromArrayTrait;
19
20
    /**
21
     * A valid file identifier for the video file.
22
     *
23
     * @var string
24
     */
25
    public $videoFileId;
26
27
    /**
28
     * Title for the result.
29
     *
30
     * @var string
31
     */
32
    public $title;
33
34
    /**
35
     * Optional. Caption of the video to be sent, 0-1024 characters.
36
     *
37
     * @var string|null
38
     */
39
    public $caption;
40
41
    /**
42
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic,
43
     * fixed-width text or inline URLs in the media caption.
44
     *
45
     * @var string|null
46
     */
47
    public $parseMode;
48
49
    /**
50
     * Optional. Short description of the result.
51
     *
52
     * @var string|null
53
     */
54
    public $description;
55
56
    /**
57
     * Optional. Content of the message to be sent instead of the video.
58
     * This field is required if InlineQueryResultVideo is used to send an HTML-page as a result
59
     * (e.g., a YouTube video).
60
     *
61
     * @var InputMessageContentType|null
62
     */
63
    public $inputMessageContent;
64
65
    /**
66
     * InlineQueryResultCachedVideoType constructor.
67
     *
68
     * @param string     $id
69
     * @param string     $videoFileId
70
     * @param string     $title
71
     * @param array|null $data
72
     *
73
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
74
     */
75
    public function __construct(string $id, string $videoFileId, string $title, array $data = null)
76
    {
77
        $this->type = self::TYPE_VIDEO;
78
        $this->id = $id;
79
        $this->videoFileId = $videoFileId;
80
        $this->title = $title;
81
        if ($data) {
82
            $this->fill($data);
83
        }
84
    }
85
}
86