public static function subscribe($event, callable $callback)
    {
        if (!isset(self::$eventSubscriptions[$event])) self::$eventSubscriptions[$event] = array();
        self::$eventSubscriptions[$event][] = $callback;

        self::receive();
    }
public static function subscribe($event, callable $callback)
    {
        if (!isset(self::$eventSubscriptions[$event])) self::$eventSubscriptions[$event] = array();
        self::$eventSubscriptions[$event][] = $callback;

        self::receive();
    }
public static function subscribe ( $ event , callable $ callback ) { if ( ! isset ( self :: $ eventSubscriptions [ $ event ] ) ) self :: $ eventSubscriptions [ $ event ] = array ( ) ; self :: $ eventSubscriptions [ $ event ] [ ] = $ callback ; self :: receive ( ) ; }
Subscribe to an incoming webhook request. The callback will be invoked when a matching webhook is received.

@param string   $event    Name of the webhook event, e.g. subscribe, unsubscribe, campaign
@param callable $callback A callable function to invoke with the data from the received webhook

@return void
Subscribe to an incoming webhook request . The callback will be invoked when a matching webhook is received .