public function FunctionCall::analyze in Drupal 7 to 8/9 Module Upgrader 8
Analyzes a target module and flags any issues found.
Parameters
TargetInterface $target: The target module.
Return value
\Drupal\drupalmoduleupgrader\IssueInterface[]
Overrides AnalyzerInterface::analyze
File
- src/
Plugin/ DMU/ Analyzer/ FunctionCall.php, line 20
Class
- FunctionCall
- Plugin annotation @Analyzer( id = "_function_call", deriver = "Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FunctionCallDeriver" )
Namespace
Drupal\drupalmoduleupgrader\Plugin\DMU\AnalyzerCode
public function analyze(TargetInterface $target) {
$indexer = $target
->getIndexer('function_call');
$issues = [];
if ($indexer
->has($this->pluginDefinition['function'])) {
$issue = $this
->buildIssue($target);
$indexer
->get($this->pluginDefinition['function'])
->each(function (FunctionCallNode $function_call) use ($issue) {
$issue
->addViolation($function_call, $this);
});
$issues[] = $issue;
}
return $issues;
}