/** * Executes the given callback, returns the callback's return value. * * @param \Philip\IRC\Event $event The Philip IRC event * * @return mixed */ public function testAndExecute(Event $event) { if ($this->shouldExecuteCallback($event->getRequest()->getMessage())) { $event->setMatches($this->getMatches()); return call_user_func($this->callback, $event); } return false; }