1 | <?php |
||
18 | final class AggregateEventArrayStream implements AggregateEventStream |
||
19 | { |
||
20 | /** |
||
21 | * @var AggregateEvent[] |
||
22 | */ |
||
23 | private $events = []; |
||
24 | |||
25 | /** |
||
26 | * AggregateEventArrayStream constructor. |
||
27 | * |
||
28 | * @param (AggregateEvent|mixed)[] $events |
||
29 | * |
||
30 | * @throws InvalidAggregateEventException |
||
31 | */ |
||
32 | public function __construct(array $events) |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | * |
||
50 | * @return AggregateEvent |
||
51 | */ |
||
52 | public function current(): AggregateEvent |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function next(): void |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | * |
||
68 | * @return string|int|null |
||
69 | */ |
||
70 | public function key() |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function valid(): bool |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function rewind(): void |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function count(): int |
||
98 | } |
||
99 |