Completed
Pull Request — master (#55)
by Rick
03:55 queued 01:59
created

SendLocation   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

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 july 2016
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. Sends the message silently. iOS users will not receive a notification, Android users will receive a
39
     * notification with no sound.
40
     * @see https://telegram.org/blog/channels-2-0#silent-messages
41
     * @var bool
42
     */
43
    public $disable_notification = false;
44
45
    /**
46
     * If the message is a reply, ID of the original message
47
     * @var int
48
     */
49
    public $reply_to_message_id = 0;
50
51
    /**
52
     * Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to
53
     * hide keyboard or to force a reply from the user.
54
     * @var KeyboardMethods
55
     */
56
    public $reply_markup;
57
58 1
    public function getMandatoryFields(): array
59
    {
60
        return [
61 1
            'chat_id',
62
            'latitude',
63
            'longitude',
64
        ];
65
    }
66
}
67