| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 11 | class CollectingMessageBus implements MessageBusInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var array<Envelope> |
||
| 15 | */ |
||
| 16 | private array $messages = []; |
||
| 17 | |||
| 18 | public function dispatch(object $message, array $stamps = []): Envelope |
||
| 19 | { |
||
| 20 | $envelope = new Envelope($message); |
||
| 21 | |||
| 22 | $this->messages[] = $envelope; |
||
| 23 | |||
| 24 | return $envelope; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return array<Envelope> |
||
| 29 | */ |
||
| 30 | public function getMessages(): array |
||
| 33 | } |
||
| 34 | |||
| 35 | public function clear(): void |
||
| 40 |