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