Passed
Push — master ( 47d367...c6d1df )
by Hirofumi
06:59
created

NotificationId::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
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 6
    public function __construct(int $id)
17
    {
18 6
        $this->id = $id;
19 6
    }
20
21
    /**
22
     * @return int
23
     */
24 6
    public function id(): int
25
    {
26 6
        return $this->id;
27
    }
28
29
    /**
30
     * @param NotificationId $other
31
     * @return bool
32
     */
33 1
    public function equals(NotificationId $other): bool
34
    {
35 1
        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