/** * Searches the data source for the requested function. * * @param string $functionName Name of the function to search for * * @return void */ public function onCommandPhp($functionName) { // Search for the function if ($function = $this->source->findFunction($functionName)) { $msg = 'PHP ' . $function['name'] . ': ' . $function['description']; } else { $msg = 'Search for function ' . $functionName . ' returned no results.'; } // Return the result to the source $this->doPrivmsg($this->getEvent()->getSource(), $msg); }
/** * Searches the data source for the requested function. * * @param string $functionName Name of the function to search for * * @return void */ public function onCommandPhp($functionName) { $nick = $this->event->getNick(); if ($function = $this->source->findFunction($functionName)) { $msg = $nick . ': ' . $function['description']; $this->doPrivmsg($this->event->getSource(), $msg); } else { $msg = 'Search for function ' . $functionName . ' returned no results.'; $this->doNotice($nick, $msg); } }