Passed
Pull Request — develop (#1077)
by Marco
02:09
created

InlineQueryResultPhoto   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 11
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the TelegramBot package.
5
 *
6
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace PhpTelegramBot\Core\Entities\InlineQuery;
13
14
use PhpTelegramBot\Core\Entities\InlineKeyboard;
15
use PhpTelegramBot\Core\Entities\InputMessageContent\InputMessageContent;
16
17
/**
18
 * Class InlineQueryResultPhoto
19
 *
20
 * @link https://core.telegram.org/bots/api#inlinequeryresultphoto
21
 *
22
 * <code>
23
 * $data = [
24
 *   'id'                    => '',
25
 *   'photo_url'             => '',
26
 *   'thumb_url'             => '',
27
 *   'photo_width'           => 30,
28
 *   'photo_height'          => 30,
29
 *   'title'                 => '',
30
 *   'description'           => '',
31
 *   'caption'               => '',
32
 *   'reply_markup'          => <InlineKeyboard>,
33
 *   'input_message_content' => <InputMessageContent>,
34
 * ];
35
 * </code>
36
 *
37
 * @method string               getType()                Type of the result, must be photo
38
 * @method string               getId()                  Unique identifier for this result, 1-64 bytes
39
 * @method string               getPhotoUrl()            A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB
40
 * @method string               getThumbUrl()            URL of the thumbnail for the photo
41
 * @method int                  getPhotoWidth()          Optional. Width of the photo
42
 * @method int                  getPhotoHeight()         Optional. Height of the photo
43
 * @method string               getTitle()               Optional. Title for the result
44
 * @method string               getDescription()         Optional. Short description of the result
45
 * @method string               getCaption()             Optional. Caption of the photo to be sent, 0-200 characters
46
 * @method InlineKeyboard       getReplyMarkup()         Optional. Inline keyboard attached to the message
47
 * @method InputMessageContent  getInputMessageContent() Optional. Content of the message to be sent instead of the photo
48
 *
49
 * @method $this setId(string $id)                                                  Unique identifier for this result, 1-64 bytes
50
 * @method $this setPhotoUrl(string $photo_url)                                     A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB
51
 * @method $this setThumbUrl(string $thumb_url)                                     URL of the thumbnail for the photo
52
 * @method $this setPhotoWidth(int $photo_width)                                    Optional. Width of the photo
53
 * @method $this setPhotoHeight(int $photo_height)                                  Optional. Height of the photo
54
 * @method $this setTitle(string $title)                                            Optional. Title for the result
55
 * @method $this setDescription(string $description)                                Optional. Short description of the result
56
 * @method $this setCaption(string $caption)                                        Optional. Caption of the photo to be sent, 0-200 characters
57
 * @method $this setReplyMarkup(InlineKeyboard $reply_markup)                       Optional. Inline keyboard attached to the message
58
 * @method $this setInputMessageContent(InputMessageContent $input_message_content) Optional. Content of the message to be sent instead of the photo
59
 */
60
class InlineQueryResultPhoto extends InlineEntity implements InlineQueryResult
61
{
62
    /**
63
     * InlineQueryResultPhoto constructor
64
     *
65
     * @param array $data
66
     */
67
    public function __construct(array $data = [])
68
    {
69
        $data['type'] = 'photo';
70
        parent::__construct($data);
71
    }
72
}
73