InlineQueryResultCachedPhotoType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

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