public function onChannel($pattern, $callback, $priority = 0)
    {
        $handler = new EventListener($pattern, $callback);
        $this->dispatcher->addListener('message.channel', array($handler, 'testAndExecute'), $priority);

        return $this;
    }
public function onChannel($pattern, $callback, $priority = 0)
    {
        $handler = new EventListener($pattern, $callback);
        $this->dispatcher->addListener('message.channel', array($handler, 'testAndExecute'), $priority);

        return $this;
    }
public function onChannel ( $ pattern , $ callback , $ priority = 0 ) { $ handler = new EventListener ( $ pattern , $ callback ) ; $ this -> dispatcher -> addListener ( 'message.channel' , array ( $ handler , 'testAndExecute' ) , $ priority ) ; return $ this ; }
Adds an event handler to the list for when someone talks in a channel.

@param string   $pattern  The RegEx to test the message against
@param callable $callback The callback to run if the pattern matches
@param integer  $priority The priority of this event handler

@return \Philip\Philip
Adds an event handler to the list for when someone talks in a channel .