UserId   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 4 1
A equals() 0 4 1
A __construct() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace N1215\SimpleAdr\Domain;
5
6
/**
7
 * User ID
8
 * @package N1215\SimpleAdr\Domain
9
 */
10
class UserId
11
{
12
    /**
13
     * @var int|null
14
     */
15
    private $userId;
16
17
    /**
18
     * @param int|null $userId
19
     */
20 5
    public function __construct(?int $userId)
21
    {
22 5
        $this->userId = $userId;
23
    }
24
25
    /**
26
     * @return int|null
27
     */
28 4
    public function getValue(): ?int
29
    {
30 4
        return $this->userId;
31
    }
32
33
    /**
34
     * @param UserId $userId
35
     * @return bool
36
     */
37 1
    public function equals(UserId $userId): bool
38
    {
39 1
        return $this->getValue() === $userId->getValue();
40
    }
41
}
42