| 1 | <?php declare(strict_types = 1); |
||
| 9 | class DomainEventCollection implements Countable |
||
| 10 | { |
||
| 11 | /** @var DomainEvent[] */ |
||
| 12 | protected $domainEvents = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param DomainEvent[] $domainEvents |
||
| 16 | */ |
||
| 17 | 14 | public function __construct(array $domainEvents) |
|
| 21 | |||
| 22 | /** |
||
| 23 | * @return DomainEvent[] |
||
| 24 | */ |
||
| 25 | 1 | public function getAll(): array |
|
| 29 | |||
| 30 | 3 | public function getDomainEventOfType(string $type): ?DomainEvent |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @param string $type |
||
| 48 | * |
||
| 49 | * @return DomainEvent[] |
||
| 50 | */ |
||
| 51 | 5 | public function getDomainEventsOfType(string $type): array |
|
| 62 | |||
| 63 | 9 | public function count(): int |
|
| 67 | } |
||
| 68 | |||
| 70 |