Completed
Pull Request — develop (#291)
by Armando
15:42
created

InlineQueryResultLocation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
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\InlineQuery;
12
13
use Longman\TelegramBot\Entities\InlineKeyboard;
14
use Longman\TelegramBot\Entities\InputMessageContent\InputMessageContent;
15
16
/**
17
 * Class InlineQueryResultLocation
18
 *
19
 * @link https://core.telegram.org/bots/api#inlinequeryresultlocation
20
 *
21
 * <code>
22
 * $data = [
23
 *   'id'                    => '',
24
 *   'latitude'              => 36.0338,
25
 *   'longitude'             => 71.8601,
26
 *   'title'                 => '',
27
 *   'reply_markup'          => <InlineKeyboard>,
28
 *   'input_message_content' => <InputMessageContent>,
29
 *   'thumb_url'             => '',
30
 *   'thumb_width'           => 30,
31
 *   'thumb_height'          => 30,
32
 * ];
33
 * </code>
34
 *
35
 * @method string               getType()                Type of the result, must be location
36
 * @method string               getId()                  Unique identifier for this result, 1-64 Bytes
37
 * @method float                getLatitude()            Location latitude in degrees
38
 * @method float                getLongitude()           Location longitude in degrees
39
 * @method string               getTitle()               Location title
40
 * @method InlineKeyboard       getReplyMarkup()         Optional. Inline keyboard attached to the message
41
 * @method InputMessageContent  getInputMessageContent() Optional. Content of the message to be sent instead of the location
42
 * @method string               getThumbUrl()            Optional. Url of the thumbnail for the result
43
 * @method int                  getThumbWidth()          Optional. Thumbnail width
44
 * @method int                  getThumbHeight()         Optional. Thumbnail height
45
 *
46
 * @method $this setId(string $id)                                                  Unique identifier for this result, 1-64 Bytes
47
 * @method $this setLatitude(float $latitude)                                       Location latitude in degrees
48
 * @method $this setLongitude(float $longitude)                                     Location longitude in degrees
49
 * @method $this setTitle(string $title)                                            Location title
50
 * @method $this setReplyMarkup(InlineKeyboard $reply_markup)                       Optional. Inline keyboard attached to the message
51
 * @method $this setInputMessageContent(InputMessageContent $input_message_content) Optional. Content of the message to be sent instead of the location
52
 * @method $this setThumbUrl(string $thumb_url)                                     Optional. Url of the thumbnail for the result
53
 * @method $this setThumbWidth(int $thumb_width)                                    Optional. Thumbnail width
54
 * @method $this setThumbHeight(int $thumb_height)                                  Optional. Thumbnail height
55
 */
56
class InlineQueryResultLocation extends InlineEntity
57
{
58
    /**
59
     * InlineQueryResultLocation constructor
60
     *
61
     * @param array $data
62
     *
63
     * @throws \Longman\TelegramBot\Exception\TelegramException
64
     */
65
    public function __construct(array $data = [])
66
    {
67
        $data['type'] = 'location';
68
        parent::__construct($data);
69
    }
70
}
71