public function lastEvent() { if ($this->eventCount) { return $this->events[$this->eventCount - 1]; } throw new UndefinedEventException(0); }