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

NotificationNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 30
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A notificationId() 0 4 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