InlineQueryResultCachedMpeg4GifType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 15
dl 0
loc 58
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 14 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Type\InlineQueryResult;
6
7
use TgBotApi\BotApiBase\Method\Interfaces\HasParseModeVariableInterface;
8
use TgBotApi\BotApiBase\Method\Traits\FillFromArrayTrait;
9
use TgBotApi\BotApiBase\Type\InputMessageContent\InputMessageContentType;
10
use TgBotApi\BotApiBase\Type\Traits\CaptionEntitiesFieldTrait;
11
12
/**
13
 * Class InlineQueryResultCachedMpeg4GifType.
14
 *
15
 * @see https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif
16
 */
17
class InlineQueryResultCachedMpeg4GifType extends InlineQueryResultType implements HasParseModeVariableInterface
18
{
19
    use CaptionEntitiesFieldTrait;
20
    use FillFromArrayTrait;
21
22
    /**
23
     * A valid file identifier for the MP4 file.
24
     *
25
     * @var string
26
     */
27
    public $mpeg4FileId;
28
29
    /**
30
     * Optional. Title for the result.
31
     *
32
     * @var string|null
33
     */
34
    public $title;
35
36
    /**
37
     * Optional. Caption of the GIF file to be sent, 0-1024 characters.
38
     *
39
     * @var string|null
40
     */
41
    public $caption;
42
43
    /**
44
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic,
45
     * fixed-width text or inline URLs in the media caption.
46
     *
47
     * @var string|null
48
     */
49
    public $parseMode;
50
51
    /**
52
     * Optional. Content of the message to be sent instead of the GIF animation.
53
     *
54
     * @var InputMessageContentType|null
55
     */
56
    public $inputMessageContent;
57
58
    /**
59
     * @throws \TgBotApi\BotApiBase\Exception\BadArgumentException
60
     */
61
    public static function create(
62
        string $id,
63
        string $mpeg4FileId,
64
        array $data = null
65
    ): InlineQueryResultCachedMpeg4GifType {
66
        $instance = new static();
67
        $instance->type = static::TYPE_MPEG4GIF;
68
        $instance->id = $id;
69
        $instance->mpeg4FileId = $mpeg4FileId;
70
        if ($data) {
71
            $instance->fill($data);
72
        }
73
74
        return $instance;
75
    }
76
}
77