Completed
Push — master ( 4a3e49...406f94 )
by Alejandro
16s queued 12s
created

Location::countryCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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 33
    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 33
        $this->countryCode = $countryCode;
33 33
        $this->countryName = $countryName;
34 33
        $this->regionName = $regionName;
35 33
        $this->city = $city;
36 33
        $this->latitude = $latitude;
37 33
        $this->longitude = $longitude;
38 33
        $this->timeZone = $timeZone;
39
    }
40
41 19
    public static function emptyInstance(): self
42
    {
43 19
        return new self('', '', '', '', 0.0, 0.0, '');
44
    }
45
46 22
    public function countryCode(): string
47
    {
48 22
        return $this->countryCode;
49
    }
50
51 22
    public function countryName(): string
52
    {
53 22
        return $this->countryName;
54
    }
55
56 22
    public function regionName(): string
57
    {
58 22
        return $this->regionName;
59
    }
60
61 22
    public function city(): string
62
    {
63 22
        return $this->city;
64
    }
65
66 22
    public function latitude(): float
67
    {
68 22
        return $this->latitude;
69
    }
70
71 22
    public function longitude(): float
72
    {
73 22
        return $this->longitude;
74
    }
75
76 22
    public function timeZone(): string
77
    {
78 22
        return $this->timeZone;
79
    }
80
}
81