Completed
Push — master ( 588078...30ae0c )
by Nikolay
04:51 queued 02:15
created

InlineQueryResultMpeg4GifType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 90
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 17
dl 0
loc 90
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 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 InlineQueryResultMpeg4GifType.
13
 *
14
 * @see https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif
15
 */
16
class InlineQueryResultMpeg4GifType extends InlineQueryResultType implements HasParseModeVariableInterface
17
{
18
    use FillFromArrayTrait;
19
20
    /**
21
     * A valid URL for the MP4 file. File size must not exceed 1MB.
22
     *
23
     * @var string
24
     */
25
    public $mpeg4Url;
26
27
    /**
28
     * Optional. Video width.
29
     *
30
     * @var int|null
31
     */
32
    public $mpeg4Width;
33
34
    /**
35
     * Optional. Video height.
36
     *
37
     * @var int|null
38
     */
39
    public $mpeg4Height;
40
41
    /**
42
     * Optional. Video duration.
43
     *
44
     * @var int|null
45
     */
46
    public $mpeg4Duration;
47
48
    /**
49
     * URL of the static thumbnail (jpeg or gif) for the result.
50
     *
51
     * @var string
52
     */
53
    public $thumbUrl;
54
55
    /**
56
     * Optional. Title for the result.
57
     *
58
     * @var string|null
59
     */
60
    public $title;
61
62
    /**
63
     * Optional. Caption of the GIF file to be sent, 0-1024 characters.
64
     *
65
     * @var string|null
66
     */
67
    public $caption;
68
69
    /**
70
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic,
71
     * fixed-width text or inline URLs in the media caption.
72
     *
73
     * @var string|null
74
     */
75
    public $parseMode;
76
77
    /**
78
     * Optional. Content of the message to be sent instead of the GIF animation.
79
     *
80
     * @var InputMessageContentType|null
81
     */
82
    public $inputMessageContent;
83
84
    /**
85
     * InlineQueryResultMpeg4GifType constructor.
86
     *
87
     * @param string     $id
88
     * @param string     $mpeg4Url
89
     * @param string     $thumbUrl
90
     * @param array|null $data
91
     *
92
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
93
     */
94
    public function __construct(
95
        string $id,
96
        string $mpeg4Url,
97
        string $thumbUrl,
98
        array $data = null
99
    ) {
100
        $this->type = self::TYPE_MPEG4GIF;
101
        $this->id = $id;
102
        $this->mpeg4Url = $mpeg4Url;
103
        $this->thumbUrl = $thumbUrl;
104
        if ($data) {
105
            $this->fill($data);
106
        }
107
    }
108
}
109