Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| Notification | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getMessageId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getIdentityInfo | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPayload | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Notification\Domain\Model; |
| 4 | |
| 5 | /** |
| 6 | * Generic Notification object that will be passed to infrastructure to be sent |
| 7 | * |
| 8 | * @author Wilhelm Zwertvaegher |
| 9 | */ |
| 10 | abstract class Notification |
| 11 | { |
| 12 | |
| 13 | /** |
| 14 | * @param string $messageId |
| 15 | * @param IdentityInfo $identityInfo |
| 16 | * @param NotificationType $type |
| 17 | * @param array<string, string|int> $payload |
| 18 | */ |
| 19 | public function __construct( |
| 20 | private readonly string $messageId, |
| 21 | private readonly IdentityInfo $identityInfo, |
| 22 | private readonly NotificationType $type, |
| 23 | private readonly array $payload |
| 24 | ) { |
| 25 | } |
| 26 | |
| 27 | public function getMessageId(): string |
| 28 | { |
| 29 | return $this->messageId; |
| 30 | } |
| 31 | |
| 32 | public function getIdentityInfo(): IdentityInfo |
| 33 | { |
| 34 | return $this->identityInfo; |
| 35 | } |
| 36 | |
| 37 | public function getType(): NotificationType |
| 38 | { |
| 39 | return $this->type; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @return array<string, string|int> |
| 44 | */ |
| 45 | public function getPayload(): array |
| 46 | { |
| 47 | return $this->payload; |
| 48 | } |
| 49 | } |