GeographicCoordinates   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 58
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 2

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getLatitude() 0 4 1
A getLongitude() 0 4 1
A getUriParameterValue() 0 6 1
A getUriParameterName() 0 4 1
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