Passed
Push — master ( 50509a...5c86f2 )
by Hirofumi
03:29
created

NotificationId::equals()   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
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Shippinno\Notification\Domain\Model;
5
6
class NotificationId
7
{
8
    /**
9
     * @var int
10
     */
11
    private $id;
12
13
    /**
14
     * @param int $id
15
     */
16 3
    public function __construct(int $id)
17
    {
18 3
        $this->id = $id;
19 3
    }
20
21
    /**
22
     * @return int
23
     */
24 3
    public function id(): int
25
    {
26 3
        return $this->id;
27
    }
28
29
    /**
30
     * @param NotificationId $other
31
     * @return bool
32
     */
33
    public function equals(NotificationId $other): bool
34
    {
35
        return $this->id() === $other->id();
36
    }
37
38
    /**
39
     * @return string
40
     */
41 3
    public function __toString(): string
42
    {
43 3
        return strval($this->id());
44
    }
45
}
46