Passed
Push — master ( 5fd2da...e7369d )
by Derek Stephen
12:54
created

Country::getTimezone()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 1
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Entity;
6
7
use DateTimeZone;
8
9
class Country
10
{
11
    private string $id = '';
12
    private string $iso = '';
13
    private string $name = '';
14
    private int $numCode = 0;
15
    private string $flag = '';
16
    private DateTimeZone $timezone;
17 2
18
    /**
19 2
     * @param string $flag
20
     */
21
    public function __construct(string $flag)
22 3
    {
23
        $this->flag = $flag;
24 3
    }
25
26
    public function getId(): string
27 2
    {
28
        return $this->id;
29 2
    }
30
31
    public function setId(string $id): void
32 3
    {
33
        $this->id = $id;
34 3
    }
35
36
    public function getIso(): string
37 2
    {
38
        return $this->iso;
39 2
    }
40
41
    public function setIso(string $iso): void
42 3
    {
43
        $this->iso = $iso;
44 3
    }
45
46
    public function getName(): string
47 2
    {
48
        return $this->name;
49 2
    }
50
51
    public function setName(string $name): void
52 3
    {
53
        $this->name = $name;
54 3
    }
55
56
    public function getNumCode(): int
57 3
    {
58
        return $this->numCode;
59 3
    }
60
61
    public function setNumCode(int $numCode): void
62 3
    {
63
        $this->numCode = $numCode;
64 3
    }
65
66
    public function getFlag(): string
67
    {
68
        return $this->flag;
69
    }
70
71
    public function setFlag(string $flag): void
72
    {
73
        $this->flag = $flag;
74
    }
75
76
    public function getTimezone(): DateTimeZone
77
    {
78
        return $this->timezone;
79
    }
80
81
    public function setTimezone(DateTimeZone $timezone): void
82
    {
83
        $this->timezone = $timezone;
84
    }
85
86
    public function toArray(): array
87
    {
88
        return [
89
            'id' => $this->id,
90
            'iso' => $this->iso,
91
            'num_code' => $this->numCode,
92
            'numCode' => $this->numCode,
93
            'flag' => $this->flag,
94
            'timezone' => $this->timezone
95
        ];
96
    }
97
98
    public function __toString(): string
99
    {
100
        return $this->iso;
101
    }
102
}
103