Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
39 | 2 | public function handle(SendNotification $command): void |
|
40 | { |
||
41 | 2 | $notificationId = new NotificationId($command->notificationId()); |
|
42 | 2 | $notification = $this->notificationRepository->notificationOfId($notificationId); |
|
43 | 2 | if (is_null($notification)) { |
|
44 | 1 | throw new NotificationNotFoundException($notificationId); |
|
45 | } |
||
46 | 1 | $this->gatewayRegistry->get($notification->destination())->send($notification); |
|
47 | 1 | $notification->markSent(); |
|
48 | 1 | } |
|
49 | } |
||
50 |