Passed
Push — master ( a8b983...5b3176 )
by Adrien
10:48
created

Country::setCode()   A

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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Model;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use Ecodev\Felix\Model\Traits\HasName;
9
10
/**
11
 * A country
12
 *
13
 * @ORM\Entity(repositoryClass="\Application\Repository\CountryRepository")
14
 */
15
class Country extends AbstractModel
16
{
17
    use HasName;
18
19
    /**
20
     * @var string
21
     * @ORM\Column(type="string", length=2, unique=true)
22
     */
23
    private $code = '';
24
25
    /**
26
     * Set ISO 3166-1 alpha-2 country code
27
     */
28
    public function setCode(string $code): void
29
    {
30
        $this->code = $code;
31
    }
32
33
    /**
34
     * Get ISO 3166-1 alpha-2 country code
35
     */
36
    public function getCode(): string
37
    {
38
        return $this->code;
39
    }
40
}
41