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

Country   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 107
Duplicated Lines 0 %

Test Coverage

Coverage 74.07%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
eloc 22
c 4
b 1
f 1
dl 0
loc 107
ccs 20
cts 27
cp 0.7407
rs 10
wmc 12

12 Methods

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