Passed
Push — master ( 11660b...cf3598 )
by Derek Stephen
13:07 queued 11:27
created

Country::setTimezone()   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
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
18 2
    public function getId(): string
19
    {
20 2
        return $this->id;
21
    }
22
23 3
    public function setId(string $id): void
24
    {
25 3
        $this->id = $id;
26
    }
27
28 2
    public function getIso(): string
29
    {
30 2
        return $this->iso;
31
    }
32
33 3
    public function setIso(string $iso): void
34
    {
35 3
        $this->iso = $iso;
36
    }
37
38 2
    public function getName(): string
39
    {
40 2
        return $this->name;
41
    }
42
43 3
    public function setName(string $name): void
44
    {
45 3
        $this->name = $name;
46
    }
47
48 2
    public function getNumCode(): int
49
    {
50 2
        return $this->numCode;
51
    }
52
53 3
    public function setNumCode(int $numCode): void
54
    {
55 3
        $this->numCode = $numCode;
56
    }
57
58 3
    public function getFlag(): string
59
    {
60 3
        return $this->flag;
61
    }
62
63 3
    public function setFlag(string $flag): void
64
    {
65 3
        $this->flag = $flag;
66
    }
67
68 1
    public function getTimezone(): DateTimeZone
69
    {
70 1
        return $this->timezone;
71
    }
72
73 2
    public function setTimezone(DateTimeZone $timezone): void
74
    {
75 2
        $this->timezone = $timezone;
76
    }
77
78
    public function toArray(): array
79
    {
80
        return [
81
            'id' => $this->id,
82
            'iso' => $this->iso,
83
            'num_code' => $this->numCode,
84
            'numCode' => $this->numCode,
85
            'flag' => $this->flag,
86
            'timezone' => $this->timezone
87
        ];
88
    }
89
90
    public function __toString(): string
91
    {
92
        return $this->iso;
93
    }
94
}
95