Completed
Push — IncomprehensibleFinder/SandraA... ( c60dee )
by Albert
02:20
created

Person::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Kata\Algorithm;
6
7
use DateTime;
8
9
final class Person
10
{
11
    /** @var string */
12
    private $name;
13
14
    /** @var DateTime */
15
    private $birthDate;
16
17
    public function __construct(string $name, string $birthDate)
18
    {
19
        $this->name = $name;
20
        $this->birthDate = new DateTime($birthDate);
21
    }
22
23
    public function getName(): string
24
    {
25
        return $this->name;
26
    }
27
28
    public function setName(string $name)
29
    {
30
        $this->name = $name;
31
    }
32
33
    public function getBirthDate(): DateTime
34
    {
35
        return $this->birthDate;
36
    }
37
38
    public function setBirthDate(DateTime $birthDate)
39
    {
40
        $this->birthDate = $birthDate;
41
    }
42
}
43