Completed
Push — master ( 54823d...3e7af9 )
by Armando
04:43 queued 02:31
created

InputMediaPhoto::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of the TelegramBot package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\TelegramBot\Entities\InputMedia;
12
13
use Longman\TelegramBot\Entities\Entity;
14
15
/**
16
 * Class InputMediaPhoto
17
 *
18
 * @link https://core.telegram.org/bots/api#inputmediaphoto
19
 *
20
 * <code>
21
 * $data = [
22
 *   'media'   => '123abc',
23
 *   'caption' => 'Photo caption',
24
 * ];
25
 * </code>
26
 *
27
 * @method string getType()    Type of the result, must be photo
28
 * @method string getMedia()   File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
29
 * @method string getCaption() Optional. Caption of the photo to be sent, 0-200 characters
30
 *
31
 * @method $this setMedia(string $media)     File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
32
 * @method $this setCaption(string $caption) Optional. Caption of the photo to be sent, 0-200 characters
33
 */
34
class InputMediaPhoto extends Entity implements InputMedia
35
{
36
    /**
37
     * InputMediaPhoto constructor
38
     *
39
     * @param array $data
40
     *
41
     * @throws \Longman\TelegramBot\Exception\TelegramException
42
     */
43
    public function __construct(array $data = [])
44
    {
45
        $data['type'] = 'photo';
46
        parent::__construct($data);
47
    }
48
}
49