queue[] = [ 'name' => $name, 'payload' => $payload, 'type' => $type, ]; } /** * Retrieves the queued events. * * @return array */ public function getQueuedEvents(): array { return $this->queue; } /** * Clears the event queue. */ public function clear(): void { $this->queue = []; } /** * Renders inline JavaScript statements to emit queued events. * * @return string */ public function renderInlineJs(): string { if (empty($this->queue)) { return ''; } $lines = [""; return implode("\n", $lines); } }