Passed
Push — master ( dd3a40...b9ffdf )
by Hirofumi
07:38
created

NotificationNotFoundException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 9.9332
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
use Exception;
7
8
class NotificationNotFoundException extends Exception
9
{
10
    /**
11
     * @var NotificationId
12
     */
13
    private $notificationId;
14
15
    /**
16
     * NotificationNotFoundException constructor.
17
     * @param NotificationId $notificationId
18
     */
19 1
    public function __construct(NotificationId $notificationId)
20
    {
21 1
        $this->notificationId = $notificationId;
22 1
        parent::__construct(
23 1
            sprintf(
24 1
                'Notification (%s) does not exits.',
25 1
                $this->notificationId()->id()
26
            )
27
        );
28 1
    }
29
30
    /**
31
     * @return NotificationId
32
     */
33 1
    public function notificationId(): NotificationId
34
    {
35 1
        return $this->notificationId;
36
    }
37
}
38