InputMedia   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 122
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 19
c 1
b 0
f 0
dl 0
loc 122
ccs 0
cts 20
cp 0
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A setParseMode() 0 3 1
A setCaption() 0 3 1
A getMedia() 0 3 1
A getCaption() 0 3 1
A setType() 0 3 1
A setMedia() 0 3 1
A getParseMode() 0 3 1
1
<?php
2
3
namespace TelegramBot\Api\Types\InputMedia;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\Collection\CollectionItemInterface;
7
8
/**
9
 * Class InputMedia
10
 * This object represents the content of a media message to be sent.
11
 *
12
 * @package TelegramBot\Api
13
 */
14
class InputMedia extends BaseType implements CollectionItemInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     *
19
     * @var array
20
     */
21
    protected static $requiredParams = ['type', 'media'];
22
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @var array
27
     */
28
    protected static $map = [
29
        'type' => true,
30
        'media' => true,
31
        'caption' => true,
32
        'parse_mode' => true,
33
    ];
34
35
    /**
36
     * Type of the result.
37
     *
38
     * @var string
39
     */
40
    protected $type;
41
42
    /**
43
     * File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended),
44
     * pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>"
45
     * to upload a new one using multipart/form-data under <file_attach_name> name.
46
     *
47
     * @var string
48
     */
49
    protected $media;
50
51
    /**
52
     * Optional. Caption of the photo to be sent, 0-200 characters.
53
     *
54
     * @var string|null
55
     */
56
    protected $caption;
57
58
    /**
59
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic,
60
     * fixed-width text or inline URLs in the media caption.
61
     *
62
     * @var string|null
63
     */
64
    protected $parseMode;
65
66
    /**
67
     * @return string
68
     */
69
    public function getType()
70
    {
71
        return $this->type;
72
    }
73
74
    /**
75
     * @param string $type
76
     *
77
     * @return void
78
     */
79
    public function setType($type)
80
    {
81
        $this->type = $type;
82
    }
83
84
    /**
85
     * @return string
86
     */
87
    public function getMedia()
88
    {
89
        return $this->media;
90
    }
91
92
    /**
93
     * @param string $media
94
     *
95
     * @return void
96
     */
97
    public function setMedia($media)
98
    {
99
        $this->media = $media;
100
    }
101
102
    /**
103
     * @return string|null
104
     */
105
    public function getCaption()
106
    {
107
        return $this->caption;
108
    }
109
110
    /**
111
     * @param string|null $caption
112
     *
113
     * @return void
114
     */
115
    public function setCaption($caption)
116
    {
117
        $this->caption = $caption;
118
    }
119
120
    /**
121
     * @return string|null
122
     */
123
    public function getParseMode()
124
    {
125
        return $this->parseMode;
126
    }
127
128
    /**
129
     * @param string|null $parseMode
130
     *
131
     * @return void
132
     */
133
    public function setParseMode($parseMode)
134
    {
135
        $this->parseMode = $parseMode;
136
    }
137
}
138