3 namespace Drupal\drupalmoduleupgrader;
7 interface IssueInterface {
10 * Returns the title of the issue.
14 public function getTitle();
17 * Sets the title of the issue.
19 * @param string $title
23 public function setTitle($title);
26 * Returns the issue summary.
30 public function getSummary();
33 * Sets the issue summary.
35 * @param string $summary
39 public function setSummary($summary);
42 * Adds a piece of documentation relevant to the issue.
45 * The documentation's full URL.
46 * @param string $title
47 * The documentation's displayed title.
51 public function addDocumentation($url, $title);
54 * Returns all documentation as an array of arrays, each containing 'url'
59 public function getDocumentation();
62 * Marks a particular file as being affected by this issue.
65 * The path of the affected file.
66 * @param \Drupal\drupalmoduleupgrader\AnalyzerInterface $detector
67 * The plugin which detected the problem.
71 public function addAffectedFile($file, AnalyzerInterface $detector);
74 * Flags a single violation of this issue in a particular syntax node.
76 * @param \Pharborist\Node $node
77 * The offending syntax tree node.
78 * @param \Drupal\drupalmoduleupgrader\AnalyzerInterface $detector
79 * The plugin which detected the violation.
83 public function addViolation(Node $node, AnalyzerInterface $detector);
86 * Returns all violations as an array of arrays, each of which has a 'file' key
87 * (required), and an optional 'line_number' key.
91 public function getViolations();
94 * Returns the fully qualified names of every plugin which detected violations,
95 * as set by addAffectedFile() and addViolation().
99 public function getDetectors();
102 * Returns if a tag is set on the issue.
109 public function hasTag($tag);
112 * Returns the value set for a tag. The tag value can be anything; the
113 * meaning of the value depends on the tag.
120 public function getTag($tag);
123 * Sets the value for a tag. Any existing value for the tag will be
128 * @param mixed $value
129 * The tag value. Can be anything.
133 public function setTag($tag, $value);
136 * Clears all values for a tag.
143 public function clearTag($tag);
146 * Gets all fixes queued for this issue. Each fix will be an array with at
147 * least a _plugin_id element, containing the plugin ID of the fixer to use.
148 * Everything else will be given to the fixer as configuration.
152 public function getFixes();
155 * Adds a fix for this issue.
157 * @param string $fixer_id
158 * The plugin ID of the fixer to use.
159 * @param array $configuration
160 * Optional configuration for the fixer.
164 public function addFix($fixer_id, array $configuration = []);