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

Country   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 92
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 5
Bugs 1 Features 1
Metric Value
eloc 28
c 5
b 1
f 1
dl 0
loc 92
ccs 20
cts 30
cp 0.6667
rs 10
wmc 15

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getNumCode() 0 3 1
A getTimezone() 0 3 1
A setName() 0 3 1
A toArray() 0 9 1
A setTimezone() 0 3 1
A getId() 0 3 1
A setIso() 0 3 1
A getName() 0 3 1
A __construct() 0 3 1
A __toString() 0 3 1
A setId() 0 3 1
A setFlag() 0 3 1
A setNumCode() 0 3 1
A getIso() 0 3 1
A getFlag() 0 3 1
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