events[] = $event; return $this; } /** * Release all the added events. * * @return EventInterface[] */ public function releaseEvents() { $events = $this->events; $this->events = []; return $events; } }