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