/** * @param RawMessage $message * @return null|SystemMessage */ public function createSystemMessage(RawMessage $message) { if ($message->command() !== 'PRIVMSG') { return SystemMessage::from($message); } return null; }
public function run() { $this->logHeading('Spires listening'); $parser = new Parser(); while ($raw = $this->read()) { if (!($raw = trim($raw))) { continue; } $this->logLine(); $this->logRead($raw); $message = RawMessage::fromArray($parser->parse($raw . "\r\n")); $this->dispatcher->dispatch($message); } }