Fenos\Notifynder\Handler\NotifynderHandler::getEventName PHP Method

getEventName() protected method

given user.post.add -> postAdd given user@postAdd -> postAdd
protected getEventName ( $event ) : string
$event
return string
    protected function getEventName($event)
    {
        // Remove the Notifynder namespaces for
        // the find the method
        $event = str_replace(Dispatcher::$defaultWildcard . '.', '', $event);
        $eventNameSpace = strpos($event, '@') ? explode('@', $event) : explode('.', $event);
        // Check if the name has been splitted in 2
        if (count($eventNameSpace) > 1) {
            array_shift($eventNameSpace);
        }
        $nameMethod = implode('_', $eventNameSpace);
        return camel_case($nameMethod);
    }