Country   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 23
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCode() 0 3 1
A setCode() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Model;
6
7
use Application\Repository\CountryRepository;
8
use Doctrine\ORM\Mapping as ORM;
9
use Ecodev\Felix\Model\Traits\HasName;
10
11
/**
12
 * A country.
13
 */
14
#[ORM\Entity(CountryRepository::class)]
15
#[ORM\Index(name: 'FULLTEXT__COUNTRY_NAME', flags: ['fulltext'], fields: ['name'])]
16
class Country extends AbstractModel
17
{
18
    use HasName;
19
20
    #[ORM\Column(type: 'string', length: 2, unique: true)]
21
    private string $code = '';
22
23
    /**
24
     * Set ISO 3166-1 alpha-2 country code.
25
     */
26
    public function setCode(string $code): void
27
    {
28
        $this->code = $code;
29
    }
30
31
    /**
32
     * Get ISO 3166-1 alpha-2 country code.
33
     */
34
    public function getCode(): string
35
    {
36
        return $this->code;
37
    }
38
}
39