Passed
Push — master ( cdc883...5b7063 )
by Derek Stephen
08:42 queued 07:12
created

Country   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 5
Bugs 1 Features 1
Metric Value
eloc 23
c 5
b 1
f 1
dl 0
loc 72
ccs 20
cts 30
cp 0.6667
rs 10
wmc 12

12 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 3 1
A getNumCode() 0 3 1
A toArray() 0 8 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
2
3
declare(strict_types=1);
4
5
namespace Del\Entity;
6
7
use JsonSerializable;
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
17 2
    public function getId(): string
18
    {
19 2
        return $this->id;
20
    }
21
22 3
    public function setId(string $id): void
23
    {
24 3
        $this->id = $id;
25
    }
26
27 2
    public function getIso(): string
28
    {
29 2
        return $this->iso;
30
    }
31
32 3
    public function setIso(string $iso): void
33
    {
34 3
        $this->iso = $iso;
35
    }
36
37 2
    public function getName(): string
38
    {
39 2
        return $this->name;
40
    }
41
42 3
    public function setName(string $name): void
43
    {
44 3
        $this->name = $name;
45
    }
46
47 2
    public function getNumCode(): int
48
    {
49 2
        return $this->numCode;
50
    }
51
52 3
    public function setNumCode(int $numCode): void
53
    {
54 3
        $this->numCode = $numCode;
55
    }
56
57 3
    public function getFlag(): string
58
    {
59 3
        return $this->flag;
60
    }
61
62 3
    public function setFlag(string $flag): void
63
    {
64 3
        $this->flag = $flag;
65
    }
66
67
    public function toArray(): array
68
    {
69
        return [
70
             'id' => $this->id,
71
             'iso' => $this->iso,
72
             'num_code' => $this->numCode,
73
             'numCode' => $this->numCode,
74
             'flag' => $this->flag,
75
        ];
76
    }
77
78
    public function __toString(): string
79
    {
80
        return $this->iso;
81
    }
82
}
83