1 | <?php |
||
11 | class InMemoryNotificationRepository implements NotificationRepository |
||
12 | { |
||
13 | /** |
||
14 | * @var Notification[] |
||
15 | */ |
||
16 | private $notifications = []; |
||
17 | |||
18 | /** |
||
19 | * @var int |
||
20 | */ |
||
21 | private $nextIdentity = 1; |
||
22 | |||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | 2 | public function add(Notification $notification): void |
|
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | 2 | public function persist(Notification $notification): void |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 3 | public function notificationOfId(NotificationId $notificationId): ?Notification |
|
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function hasNotificationOfDeduplicationKey(DeduplicationKey $deduplicationKey): bool |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 1 | public function freshNotifications(): array |
|
82 | |||
83 | /** |
||
84 | * @return NotificationId |
||
85 | */ |
||
86 | 2 | private function nextIdentity(): NotificationId |
|
90 | } |
||
91 |