Total Complexity | 8 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | trait EventProviderTrait |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | protected $events = []; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $aggregateEvents = []; |
||
19 | |||
20 | public function recordEvent(Event ...$events) |
||
24 | } |
||
25 | } |
||
26 | |||
27 | public function aggregateEventsFrom(ProvidesEvent ...$eventRecorders) |
||
31 | } |
||
32 | } |
||
33 | |||
34 | public function pullEventsFrom(ProvidesEvent ...$eventRecorders) |
||
35 | { |
||
36 | foreach ($eventRecorders as $eventRecorder) { |
||
37 | $this->recordEvent(...$eventRecorder->releaseEvents()); |
||
38 | } |
||
39 | } |
||
40 | |||
41 | public function releaseEvents(): Generator |
||
47 | } |
||
48 | } |
||
50 |