GeographicCoordinates::getUriParameterName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Marek\OpenWeatherMap\API\Value\Parameter\Input;
6
7
use Marek\OpenWeatherMap\API\Value\Parameter\UriParameterInterface;
8
9
class GeographicCoordinates implements UriParameterInterface
10
{
11
    /**
12
     * @var \Marek\OpenWeatherMap\API\Value\Parameter\Input\Latitude
13
     */
14
    protected $latitude;
15
16
    /**
17
     * @var \Marek\OpenWeatherMap\API\Value\Parameter\Input\Longitude
18
     */
19
    protected $longitude;
20
21
    /**
22
     * GeographicCoordinates constructor.
23
     *
24
     * @param \Marek\OpenWeatherMap\API\Value\Parameter\Input\Latitude $latitude
25
     * @param \Marek\OpenWeatherMap\API\Value\Parameter\Input\Longitude $longitude
26
     */
27
    public function __construct(Latitude $latitude, Longitude $longitude)
28
    {
29
        $this->latitude = $latitude;
30
        $this->longitude = $longitude;
31
    }
32
33
    /**
34
     * @return \Marek\OpenWeatherMap\API\Value\Parameter\Input\Latitude
35
     */
36
    public function getLatitude(): Latitude
37
    {
38
        return $this->latitude;
39
    }
40
41
    /**
42
     * @return \Marek\OpenWeatherMap\API\Value\Parameter\Input\Longitude
43
     */
44
    public function getLongitude(): Longitude
45
    {
46
        return $this->longitude;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getUriParameterValue(): string
53
    {
54
        return (string) $this->latitude->getLatitude() .
55
            ',' .
56
            (string) $this->longitude->getLongitude();
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public function getUriParameterName(): string
63
    {
64
        return 'location';
65
    }
66
}
67