InlineQueryResultVenueType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 99
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 23
dl 0
loc 99
ccs 0
cts 19
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 20 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Type\InlineQueryResult;
6
7
use TgBotApi\BotApiBase\Method\Traits\FillFromArrayTrait;
8
use TgBotApi\BotApiBase\Type\InputMessageContent\InputMessageContentType;
9
use TgBotApi\BotApiBase\Type\Traits\GooglePlaceFieldsTrait;
10
11
/**
12
 * Class InlineQueryResultVenueType.
13
 *
14
 * Represents a venue. By default, the venue will be sent by the user.
15
 * Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.
16
 *
17
 * @see https://core.telegram.org/bots/api#inlinequeryresultvenue
18
 */
19
class InlineQueryResultVenueType extends InlineQueryResultType
20
{
21
    use FillFromArrayTrait;
22
    use GooglePlaceFieldsTrait;
23
24
    /**
25
     * Latitude of the venue location in degrees.
26
     *
27
     * @var float
28
     */
29
    public $latitude;
30
31
    /**
32
     * Longitude of the venue location in degrees.
33
     *
34
     * @var float
35
     */
36
    public $longitude;
37
38
    /**
39
     * Title of the venue.
40
     *
41
     * @var string
42
     */
43
    public $title;
44
45
    /**
46
     * Address of the venue.
47
     *
48
     * @var string
49
     */
50
    public $address;
51
52
    /**
53
     * Optional. Foursquare identifier of the venue if known.
54
     *
55
     * @var string|null
56
     */
57
    public $foursquareId;
58
59
    /**
60
     * Optional. Foursquare type of the venue, if known.
61
     * (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.).
62
     *
63
     * @var string|null
64
     */
65
    public $foursquareType;
66
67
    /**
68
     * Optional. Content of the message to be sent instead of the venue.
69
     *
70
     * @var InputMessageContentType|null
71
     */
72
    public $inputMessageContent;
73
74
    /**
75
     * Optional. Url of the thumbnail for the result.
76
     *
77
     * @var string|null
78
     */
79
    public $thumbUrl;
80
81
    /**
82
     * Optional. Thumbnail width.
83
     *
84
     * @var int|null
85
     */
86
    public $thumbWidth;
87
88
    /**
89
     * Optional. Thumbnail height.
90
     *
91
     * @var int|null
92
     */
93
    public $thumbHeight;
94
95
    /**
96
     * @throws \TgBotApi\BotApiBase\Exception\BadArgumentException
97
     */
98
    public static function create(
99
        string $id,
100
        float $latitude,
101
        float $longitude,
102
        string $title,
103
        string $address,
104
        array $data = null
105
    ): InlineQueryResultVenueType {
106
        $instance = new static();
107
        $instance->type = static::TYPE_VENUE;
108
        $instance->id = $id;
109
        $instance->latitude = $latitude;
110
        $instance->longitude = $longitude;
111
        $instance->title = $title;
112
        $instance->address = $address;
113
        if ($data) {
114
            $instance->fill($data);
115
        }
116
117
        return $instance;
118
    }
119
}
120