Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / IssueInterface.php
1 <?php
2
3 namespace Drupal\drupalmoduleupgrader;
4
5 use Pharborist\Node;
6
7 interface IssueInterface {
8
9   /**
10    * Returns the title of the issue.
11    *
12    * @return string
13    */
14   public function getTitle();
15
16   /**
17    * Sets the title of the issue.
18    *
19    * @param string $title
20    *
21    * @return $this
22    */
23   public function setTitle($title);
24
25   /**
26    * Returns the issue summary.
27    *
28    * @return string
29    */
30   public function getSummary();
31
32   /**
33    * Sets the issue summary.
34    *
35    * @param string $summary
36    *
37    * @return $this
38    */
39   public function setSummary($summary);
40
41   /**
42    * Adds a piece of documentation relevant to the issue.
43    *
44    * @param string $url
45    *  The documentation's full URL.
46    * @param string $title
47    *  The documentation's displayed title.
48    *
49    * @return $this
50    */
51   public function addDocumentation($url, $title);
52
53   /**
54    * Returns all documentation as an array of arrays, each containing 'url'
55    * and 'title' keys.
56    *
57    * @return array
58    */
59   public function getDocumentation();
60
61   /**
62    * Marks a particular file as being affected by this issue.
63    *
64    * @param string $file
65    *  The path of the affected file.
66    * @param \Drupal\drupalmoduleupgrader\AnalyzerInterface $detector
67    *  The plugin which detected the problem.
68    *
69    * @return $this
70    */
71   public function addAffectedFile($file, AnalyzerInterface $detector);
72
73   /**
74    * Flags a single violation of this issue in a particular syntax node.
75    *
76    * @param \Pharborist\Node $node
77    *  The offending syntax tree node.
78    * @param \Drupal\drupalmoduleupgrader\AnalyzerInterface $detector
79    *  The plugin which detected the violation.
80    *
81    * @return $this
82    */
83   public function addViolation(Node $node, AnalyzerInterface $detector);
84
85   /**
86    * Returns all violations as an array of arrays, each of which has a 'file' key
87    * (required), and an optional 'line_number' key.
88    *
89    * @return array
90    */
91   public function getViolations();
92
93   /**
94    * Returns the fully qualified names of every plugin which detected violations,
95    * as set by addAffectedFile() and addViolation().
96    *
97    * @return string[]
98    */
99   public function getDetectors();
100
101   /**
102    * Returns if a tag is set on the issue.
103    *
104    * @param string $tag
105    *  The tag's name.
106    *
107    * @return boolean
108    */
109   public function hasTag($tag);
110
111   /**
112    * Returns the value set for a tag. The tag value can be anything; the
113    * meaning of the value depends on the tag.
114    *
115    * @param string $tag
116    *  The tag's name.
117    *
118    * @return mixed
119    */
120   public function getTag($tag);
121
122   /**
123    * Sets the value for a tag. Any existing value for the tag will be
124    * blown away.
125    *
126    * @param string $tag
127    *  The tag's name.
128    * @param mixed $value
129    *  The tag value. Can be anything.
130    *
131    * @return $this
132    */
133   public function setTag($tag, $value);
134
135   /**
136    * Clears all values for a tag.
137    *
138    * @param string $tag
139    *  The tag's name.
140    *
141    * @return $this
142    */
143   public function clearTag($tag);
144
145   /**
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.
149    *
150    * @return array[]
151    */
152   public function getFixes();
153
154   /**
155    * Adds a fix for this issue.
156    *
157    * @param string $fixer_id
158    *  The plugin ID of the fixer to use.
159    * @param array $configuration
160    *  Optional configuration for the fixer.
161    *
162    * @return $this
163    */
164   public function addFix($fixer_id, array $configuration = []);
165
166 }