1 | <?php |
||
13 | class InMemoryNotificationRepository implements NotificationRepository |
||
14 | { |
||
15 | /** |
||
16 | * @var Notification[] |
||
17 | */ |
||
18 | private $notifications = []; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | private $nextIdentity = 1; |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | 4 | public function add(Notification $notification): void |
|
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | 4 | public function persist(Notification $notification): void |
|
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | 5 | public function notificationOfId(NotificationId $notificationId): ?Notification |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 1 | public function hasNotificationOfDeduplicationKey(DeduplicationKey $deduplicationKey): bool |
|
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | 2 | public function query( |
|
95 | |||
96 | /** |
||
97 | * @return NotificationId |
||
98 | */ |
||
99 | 4 | private function nextIdentity(): NotificationId |
|
103 | } |
||
104 |