Completed
Push — master ( 6fd684...0d01f6 )
by Gusev
03:07
created

Location::setLatitude()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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
    static protected $requiredParams = ['latitude', 'longitude'];
29
30
    /**
31
     * {@inheritdoc}
32
     *
33
     * @var array
34
     */
35
    static protected $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
    /**
67
     * @return float
68
     */
69
    public function getLatitude()
70
    {
71
        return $this->latitude;
72
    }
73
74
    /**
75
     * @param float $latitude
76
     */
77
    public function setLatitude($latitude)
78
    {
79
        $this->latitude = $latitude;
80
    }
81
82
    /**
83
     * @return float
84
     */
85
    public function getLongitude()
86
    {
87
        return $this->longitude;
88
    }
89
90
    /**
91
     * @param float $longitude
92
     */
93
    public function setLongitude($longitude)
94
    {
95
        $this->longitude = $longitude;
96
    }
97
}
98