1 | <?php |
||
11 | class InMemoryNotificationRepository implements NotificationRepository |
||
12 | { |
||
13 | /** |
||
14 | * @var Notification[] |
||
15 | */ |
||
16 | private $notifications = []; |
||
17 | |||
18 | private $nextIdentity = 1; |
||
19 | |||
20 | /** |
||
21 | * {@inheritdoc} |
||
22 | */ |
||
23 | 1 | public function add(Notification $notification): void |
|
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | 2 | public function markSent(Notification $notification): void |
|
40 | |||
41 | 1 | /** |
|
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function markFailed(Notification $notification, string $reason): void |
||
49 | |||
50 | /** |
||
51 | * @param Notification $notification |
||
52 | */ |
||
53 | private function setNotification(Notification $notification): void |
||
57 | |||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function notificationOfId(NotificationId $notificationId): ?Notification |
||
70 | |||
71 | 1 | /** |
|
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function hasNotificationOfDeduplicationKey(DeduplicationKey $deduplicationKey): bool |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function unsentNotifications(): array |
||
92 | |||
93 | /** |
||
94 | * @return NotificationId |
||
95 | */ |
||
96 | private function nextIdentity(): NotificationId |
||
100 | } |
||
101 |