InputMediaPhoto   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 121
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
dl 0
loc 121
rs 10
c 1
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getMedia() 0 3 1
A setMedia() 0 3 1
A setCaption() 0 3 1
A getCaptionEntities() 0 3 1
A setType() 0 3 1
A getParseMode() 0 3 1
A getCaption() 0 3 1
A setParseMode() 0 3 1
A setCaptionEntities() 0 3 1
A getType() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zanzara\Telegram\Type\Input;
6
7
use Zanzara\Telegram\Type\MessageEntity;
8
9
/**
10
 * Represents a photo to be sent.
11
 *
12
 * More on https://core.telegram.org/bots/api#inputmediaphoto
13
 */
14
class InputMediaPhoto
15
{
16
17
    /**
18
     * Type of the result, must be photo
19
     *
20
     * @var string
21
     */
22
    private $type;
23
24
    /**
25
     * File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for
26
     * Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using
27
     * multipart/form-data under <file_attach_name> name. More info on Sending Files >>
28
     *
29
     * @var string
30
     */
31
    private $media;
32
33
    /**
34
     * Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
35
     *
36
     * @var string|null
37
     */
38
    private $caption;
39
40
    /**
41
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in
42
     * the media caption.
43
     *
44
     * @var string|null
45
     */
46
    private $parse_mode;
47
48
    /**
49
     * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
50
     *
51
     * @since zanzara 0.5.0, Telegram Bot Api 5.0
52
     *
53
     * @var \Zanzara\Telegram\Type\MessageEntity[]|null
54
     */
55
    private $caption_entities;
56
57
    /**
58
     * @return string
59
     */
60
    public function getType(): string
61
    {
62
        return $this->type;
63
    }
64
65
    /**
66
     * @param string $type
67
     */
68
    public function setType(string $type): void
69
    {
70
        $this->type = $type;
71
    }
72
73
    /**
74
     * @return string
75
     */
76
    public function getMedia(): string
77
    {
78
        return $this->media;
79
    }
80
81
    /**
82
     * @param string $media
83
     */
84
    public function setMedia(string $media): void
85
    {
86
        $this->media = $media;
87
    }
88
89
    /**
90
     * @return string|null
91
     */
92
    public function getCaption(): ?string
93
    {
94
        return $this->caption;
95
    }
96
97
    /**
98
     * @param string|null $caption
99
     */
100
    public function setCaption(?string $caption): void
101
    {
102
        $this->caption = $caption;
103
    }
104
105
    /**
106
     * @return string|null
107
     */
108
    public function getParseMode(): ?string
109
    {
110
        return $this->parse_mode;
111
    }
112
113
    /**
114
     * @param string|null $parse_mode
115
     */
116
    public function setParseMode(?string $parse_mode): void
117
    {
118
        $this->parse_mode = $parse_mode;
119
    }
120
121
    /**
122
     * @return MessageEntity[]|null
123
     */
124
    public function getCaptionEntities(): ?array
125
    {
126
        return $this->caption_entities;
127
    }
128
129
    /**
130
     * @param MessageEntity[]|null $caption_entities
131
     */
132
    public function setCaptionEntities(?array $caption_entities): void
133
    {
134
        $this->caption_entities = $caption_entities;
135
    }
136
137
}