Completed
Push — master ( a07842...20255a )
by Camilo
08:15 queued 06:12
created

SendLocation   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 57
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMandatoryFields() 0 8 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Methods;
6
7
use unreal4u\TelegramAPI\Abstracts\KeyboardMethods;
8
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
9
10
/**
11
 * Use this method to send point on the map. On success, the sent Message is returned.
12
 *
13
 * Objects defined as-is october 2017
14
 *
15
 * @see https://core.telegram.org/bots/api#sendlocation
16
 */
17
class SendLocation extends TelegramMethods
18
{
19
    /**
20
     * Unique identifier for the target chat or username of the target channel (in the format @channelusername)
21
     * @var string
22
     */
23
    public $chat_id = '';
24
25
    /**
26
     * Latitude of location
27
     * @var float
28
     */
29
    public $latitude = 0.0;
30
31
    /**
32
     * Longitude of location
33
     * @var float
34
     */
35
    public $longitude = 0.0;
36
37
    /**
38
     * Optional. Period in seconds for which the location will be updated (see Live Locations), should be between 60 and
39
     * 86400
40
     * @var int
41
     */
42
    public $live_period = 0;
43
44
    /**
45
     * Optional. Sends the message silently. iOS users will not receive a notification, Android users will receive a
46
     * notification with no sound.
47
     * @see https://telegram.org/blog/channels-2-0#silent-messages
48
     * @var bool
49
     */
50
    public $disable_notification = false;
51
52
    /**
53
     * If the message is a reply, ID of the original message
54
     * @var int
55
     */
56
    public $reply_to_message_id = 0;
57
58
    /**
59
     * Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to
60
     * hide keyboard or to force a reply from the user.
61
     * @var KeyboardMethods
62
     */
63
    public $reply_markup;
64
65 1
    public function getMandatoryFields(): array
66
    {
67
        return [
68 1
            'chat_id',
69
            'latitude',
70
            'longitude',
71
        ];
72
    }
73
}
74