Completed
Push — IncomprehensibleFinder/koldo-x... ( 1ccc0f )
by Xavier Serrat
02:32
created

Person::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 1
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
    public $name;
13
    /** @var DateTime */
14
    public $birthDate;
15
16 5
    public function equals(self $person): bool
17
    {
18 5
        return $this->name === $person->name
19 5
            && $this->birthDate === $person->birthDate;
20
    }
21
22
    public function getName(): string
23
    {
24
        return $this->name;
25
    }
26
27
    public function setName(string $name)
28
    {
29
        $this->name = $name;
30
    }
31
32
    public function getBirthDate(): DateTime
33
    {
34
        return $this->birthDate;
35
    }
36
37
    public function setBirthDate(DateTime $birthDate)
38
    {
39
        $this->birthDate = $birthDate;
40
    }
41
}
42