Total Complexity | 3 |
Total Lines | 16 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | final readonly class PendingEnvelope |
||
|
|||
25 | { |
||
26 | public function __construct( |
||
27 | public Envelope $envelope, |
||
28 | public \DateTimeImmutable $whenPended = new \DateTimeImmutable(), |
||
29 | ) {} |
||
30 | |||
31 | public function getMessageClass(): string |
||
32 | { |
||
33 | return $this->envelope->getMessage()::class; |
||
34 | } |
||
35 | |||
36 | public function isTransactional(CommitType ...$commitTypes): bool |
||
37 | { |
||
38 | return TransactionHelper::isDispatchable($this->getMessageClass(), ...$commitTypes); |
||
39 | } |
||
40 | } |
||
41 |