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

Person   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 23.08%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 33
ccs 3
cts 13
cp 0.2308
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A equals() 0 5 2
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
    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