Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Plugin / DMU / Analyzer / FunctionCall.php
1 <?php
2
3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer;
4
5 use Drupal\drupalmoduleupgrader\AnalyzerBase;
6 use Drupal\drupalmoduleupgrader\TargetInterface;
7 use Pharborist\Functions\FunctionCallNode;
8
9 /**
10  * @Analyzer(
11  *  id = "_function_call",
12  *  deriver = "Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FunctionCallDeriver"
13  * )
14  */
15 class FunctionCall extends AnalyzerBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   public function analyze(TargetInterface $target) {
21     $indexer = $target->getIndexer('function_call');
22     $issues = [];
23
24     if ($indexer->has($this->pluginDefinition['function'])) {
25       $issue = $this->buildIssue($target);
26
27       $indexer
28         ->get($this->pluginDefinition['function'])
29         ->each(function(FunctionCallNode $function_call) use ($issue) {
30           $issue->addViolation($function_call, $this);
31         });
32
33       $issues[] = $issue;
34     }
35
36     return $issues;
37   }
38
39 }