Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function popEvents(): EventCollection |
||
34 | { |
||
35 | $appliedEvents = []; |
||
36 | /** |
||
37 | * @var int $key |
||
38 | * @var AggregateChanged $event |
||
39 | */ |
||
40 | foreach ($this->events as $key => $event) { |
||
41 | $this->apply($event); |
||
42 | unset($this->events[$key]); |
||
43 | $appliedEvents[] = $event; |
||
44 | } |
||
45 | |||
46 | return EventCollection::createImmutableCollection($appliedEvents); |
||
47 | } |
||
60 |