Completed
Pull Request — master (#454)
by Alejandro
14:47
created

Location::timeZone()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Shlinkio\Shlink\IpGeolocation\Model;
5
6
final class Location
7
{
8
    /** @var string */
9
    private $countryCode;
10
    /** @var string */
11
    private $countryName;
12
    /** @var string */
13
    private $regionName;
14
    /** @var string */
15
    private $city;
16
    /** @var float */
17
    private $latitude;
18
    /** @var float */
19
    private $longitude;
20
    /** @var string */
21
    private $timeZone;
22
23
    public function __construct(
24
        string $countryCode,
25
        string $countryName,
26
        string $regionName,
27
        string $city,
28
        float $latitude,
29
        float $longitude,
30
        string $timeZone
31
    ) {
32
        $this->countryCode = $countryCode;
33
        $this->countryName = $countryName;
34
        $this->regionName = $regionName;
35
        $this->city = $city;
36
        $this->latitude = $latitude;
37
        $this->longitude = $longitude;
38
        $this->timeZone = $timeZone;
39
    }
40
41
    public static function emptyInstance(): self
42
    {
43
        return new self('', '', '', '', 0.0, 0.0, '');
44
    }
45
46
    public function countryCode(): string
47
    {
48
        return $this->countryCode;
49
    }
50
51
    public function countryName(): string
52
    {
53
        return $this->countryName;
54
    }
55
56
    public function regionName(): string
57
    {
58
        return $this->regionName;
59
    }
60
61
    public function city(): string
62
    {
63
        return $this->city;
64
    }
65
66
    public function latitude(): float
67
    {
68
        return $this->latitude;
69
    }
70
71
    public function longitude(): float
72
    {
73
        return $this->longitude;
74
    }
75
76
    public function timeZone(): string
77
    {
78
        return $this->timeZone;
79
    }
80
}
81