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

Person   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 34
c 0
b 0
f 0
wmc 5
lcom 0
cbo 0
ccs 0
cts 14
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A setName() 0 4 1
A getBirthDate() 0 4 1
A setBirthDate() 0 4 1
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