Country::setCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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