Phergie\Irc\Bot\React\Bot::getEventSubtype PHP Method

getEventSubtype() protected method

Returns an event subtype corresponding to a given event object, used to generate event names when emitting events.
protected getEventSubtype ( Phergie\Irc\Event\EventInterface $event ) : string
$event Phergie\Irc\Event\EventInterface
return string
    protected function getEventSubtype(EventInterface $event)
    {
        $subevent = '';
        if ($event instanceof CtcpEvent) {
            $subevent = 'ctcp.' . strtolower($event->getCtcpCommand());
        } elseif ($event instanceof UserEvent) {
            $subevent = strtolower($event->getCommand());
        } elseif ($event instanceof ServerEvent) {
            $subevent = strtolower($event->getCode());
        }
        return $subevent;
    }