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

InputMediaPhotoType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 18
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Type\InputMedia;
6
7
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
8
9
/**
10
 * Class InputMediaPhotoType.
11
 *
12
 * @see https://core.telegram.org/bots/api#inputmediaphoto
13
 */
14
class InputMediaPhotoType extends InputMediaType
15
{
16
    use FillFromArrayTrait;
17
18
    /**
19
     * InputMediaPhotoType constructor.
20
     *
21
     * @param $media
22
     * @param array|null $data
23
     *
24
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
25
     */
26
    public function __construct($media, array $data = null)
27
    {
28
        $this->type = self::TYPE_PHOTO;
29
        $this->media = $media;
30
        if ($data) {
31
            $this->fill($data);
32
        }
33
    }
34
}
35