/** * @param Func $function * A function to add to the code base * * @return void */ public function addFunction(Func $function) { // Add it to the map of functions $this->fqsen_func_map[$function->getFQSEN()] = $function; // Add it to the set of functions and methods $this->func_and_method_set->attach($function); }
/** * @param CodeBase $code_base * The code base in which the function exists * * @param Func $function * A function being analyzed * * @return void */ public function analyzeFunction(CodeBase $code_base, Func $function) { // As an example, we test to see if the name of the // function is `function`, and emit an issue if it is. if ($function->getName() == 'function') { $this->emitIssue($code_base, $function->getContext(), 'DemoPluginFunctionName', "Function {$function->getFQSEN()} cannot be called `function`"); } }