Completed
Push — master ( ba33b0...227996 )
by Derek Stephen
05:32
created

Country::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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