3 namespace Drupal\drupalmoduleupgrader;
6 * Base class for analyzers.
8 abstract class AnalyzerBase extends PluginBase implements AnalyzerInterface {
11 * Creates an issue with title, summary, documentation and tags pulled from
12 * the plugin definition.
14 * @param TargetInterface $target
17 * @return IssueInterface
19 protected function buildIssue(TargetInterface $target) {
20 $issue = new Issue($target, $this->pluginDefinition['message'], $this->pluginDefinition['summary']);
22 foreach ($this->pluginDefinition['documentation'] as $doc) {
23 $issue->addDocumentation($doc['url'], $doc['title']);
26 foreach ($this->pluginDefinition['tags'] as $group => $tag) {
27 $issue->setTag($group, $tag);
30 // If the plugin definition didn't supply an error_level tag, mark this
32 if (empty($this->pluginDefinition['tags']['error_level'])) {
33 $issue->setTag('error_level', 'error');