public function __destruct() { if ($this->irc && !$this->irc->feof()) { if ($this->config->getJoin()) { $this->irc->part($this->config->getChannel()); } $this->irc->quit('GitLab IRC Bot by Zoddo'); $start = time(); while (!$this->irc->feof() && time() - $start < 30) { $data = $this->irc->irc_read(3); if ($data === false) { continue; } $this->irc->callListeners($data); } } }