Location   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
eloc 13
c 0
b 0
f 0
dl 0
loc 78
ccs 0
cts 21
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getLatitude() 0 3 1
A getLongitude() 0 3 1
A setLongitude() 0 3 1
A setLatitude() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: iGusev
5
 * Date: 14/04/16
6
 * Time: 15:41
7
 */
8
9
namespace TelegramBot\Api\Types\Inline\InputMessageContent;
10
11
use TelegramBot\Api\TypeInterface;
12
use TelegramBot\Api\Types\Inline\InputMessageContent;
13
14
/**
15
 * Class Location
16
 * @see https://core.telegram.org/bots/api#inputlocationmessagecontent
17
 * Represents the content of a location message to be sent as the result of an inline query.
18
 *
19
 * @package TelegramBot\Api\Types\Inline
20
 */
21
class Location extends InputMessageContent implements TypeInterface
22
{
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @var array
27
     */
28
    protected static $requiredParams = ['latitude', 'longitude'];
29
30
    /**
31
     * {@inheritdoc}
32
     *
33
     * @var array
34
     */
35
    protected static $map = [
36
        'latitude' => true,
37
        'longitude' => true
38
    ];
39
40
    /**
41
     * Latitude of the location in degrees
42
     *
43
     * @var float
44
     */
45
    protected $latitude;
46
47
    /**
48
     * Longitude of the location in degrees
49
     *
50
     * @var float
51
     */
52
    protected $longitude;
53
54
    /**
55
     * Location constructor.
56
     * @param float $latitude
57
     * @param float $longitude
58
     */
59
    public function __construct($latitude, $longitude)
60
    {
61
        $this->latitude = $latitude;
62
        $this->longitude = $longitude;
63
    }
64
65
    /**
66
     * @return float
67
     */
68
    public function getLatitude()
69
    {
70
        return $this->latitude;
71
    }
72
73
    /**
74
     * @param float $latitude
75
     *
76
     * @return void
77
     */
78
    public function setLatitude($latitude)
79
    {
80
        $this->latitude = $latitude;
81
    }
82
83
    /**
84
     * @return float
85
     */
86
    public function getLongitude()
87
    {
88
        return $this->longitude;
89
    }
90
91
    /**
92
     * @param float $longitude
93
     *
94
     * @return void
95
     */
96
    public function setLongitude($longitude)
97
    {
98
        $this->longitude = $longitude;
99
    }
100
}
101