Skip to content

Commit

Permalink
add placeholder and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Dec 23, 2024
1 parent b9b758e commit d9c5518
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Support/Traits/Emitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public function fireEvent($event, $params = [], $halt = false)
list($event, $params) = $this->parseEventAndPayload($event, $params);

$result = [];
$once = false;

if (isset($this->emitterEventCollection[$event])) {
if (!isset($this->emitterEventSorted[$event])) {
Expand All @@ -150,16 +151,19 @@ public function fireEvent($event, $params = [], $halt = false)
}
if ($halt) {
if ($once) {
unset($this->emitterEventCollection[$event]);
unset($this->emitterEventSorted[$event]);
// unset this handler only.
#unset($this->emitterEventCollection[$event]);
#unset($this->emitterEventSorted[$event]);
}
return $response;
}
$result[] = $response;
}
if ($once) {
unset($this->emitterEventCollection[$event]);
unset($this->emitterEventSorted[$event]);

if ($once) {
// unset this handler only.
#unset($this->emitterEventCollection[$event]);
#unset($this->emitterEventSorted[$event]);
}
}
}

Expand Down

0 comments on commit d9c5518

Please sign in to comment.