Passed
Push — master ( 227996...93e4af )
by Derek Stephen
10:29
created

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